#!/usr/bin/haserl
<%
echo -en "Content-Type: text/html\r\n\r\n"
HOSTNAME="$(uci -q get "fff.system.hostname")"
data=$(echo "dump" | nc ::1 33123)
%>
<%= ${HOSTNAME} %>
Simple Babelweb
Babel information
<% echo "$data" | head -n 1 %> |
<% echo "$data" | head -n 2 | tail -n 1 %> |
<% echo "$data" | head -n 3 | tail -n 1 %> |
<% echo "$data" | head -n 4 | tail -n 1 %> |
<%
if ! [ ${GET_routes} ] && ! [ ${GET_v4table} ] && ! [ ${GET_v6table} ] && ! [ ${GET_weg} ] ; then
%>
Interfaces
<%
echo "$data" | grep interface | while read line ; do
echo "$line"
echo "
"
done
%>
Neighbours
<%
echo "$data" | grep neighbour | while read line ; do
echo $line
echo "
"
done
%>
Redistributed routes
<%
echo "$data" | grep xroute | while read line ; do
echo $line
echo "
"
done
%>
<%
fi
echo ""
if [ ${GET_routes} ]; then
%>
All routes
<%
echo "$data" | grep -w route | while read line ; do
echo "$line |
"
done
fi
if [ ${GET_v4table} ]; then
%>
Show IPv6 Routing Tabele
<%
v4routen=$(ip ro sh tab 10)
echo "$v4routen" | while read line ; do
echo "$line |
"
done
fi
if [ ${GET_v6table} ]; then
%>
Show IPv6 Routing Tabele
<%
v6routen=$(ip -6 ro sh tab 10)
echo "$v6routen" | while read line ; do
echo "$line |
"
done
fi
if [ ${GET_weg} ]; then
%>
Wege zu <%# echo ${GET_ip} %>
<%
echo "$data" | grep -w route | grep "${GET_ip}" | while read line ; do
echo "$line |
"
done
fi
%>