#!/usr/bin/haserl <% echo -en "Content-Type: text/html\r\n\r\n" HOSTNAME="$(uci -q get "fff.system.hostname")" lockfile="/tmp/simple.babelweb.lock" if [ -e $lockfile ];then if [ 30 -gt $(( $(date +%s) - $(date -r $lockfile +%s) )) ];then echo "only one access per minute!!" && exit fi fi data=$(echo "dump" | nc ::1 33123) touch $lockfile %> <%= ${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 "" done fi if [ ${GET_v4table} ]; then %>

Show IPv6 Routing Tabele

<% v4routen=$(ip ro sh tab 10) echo "$v4routen" | while read line ; do echo "" done fi if [ ${GET_v6table} ]; then %>

Show IPv6 Routing Tabele

<% v6routen=$(ip -6 ro sh tab 10) echo "$v6routen" | while read line ; do echo "" done fi if [ ${GET_weg} ]; then %>

Wege zu <%# echo ${GET_ip} %>

<% echo "$data" | grep -w route | grep "${GET_ip}" | while read line ; do echo "" done fi %>
$line
$line
$line
$line