diff --git a/src/packages/fff/fff-web-ui/files/www/public/cgi-bin/status.html b/src/packages/fff/fff-web-ui/files/www/public/cgi-bin/status.html index aed86b5c..b793b2cb 100755 --- a/src/packages/fff/fff-web-ui/files/www/public/cgi-bin/status.html +++ b/src/packages/fff/fff-web-ui/files/www/public/cgi-bin/status.html @@ -57,6 +57,7 @@ contact="$(uci -q get "fff.system.contact")" + <% if [ -f "$(command -v batctl)" ] ; then %>
Status @@ -66,6 +67,48 @@ contact="$(uci -q get "fff.system.contact")"
Lokale Clients:<% echo -n $(batctl tl -H 2> /dev/null | grep -c 'W') %>
+ <% fi + if birdc show status >/dev/null 2>&1 || pgrep babeld >/dev/null; then %> +
+ Status + + <% #Count Clients + client_count=$(bridge fdb show br br_client brport $(ls "/sys/class/net/br-client/brif" | grep -v '^bat') | grep -v self | grep -v permanent -c) + %> + +
Lokale Clients:<% echo $client_count %>
+
+
+ Babel Status + + + <% if birdc show status >/dev/null 2>&1; then + neighbours="$(birdc -r show babel neighbors | tail -n +5 | awk '{ printf "", $1, $2, $3 }')" + fi + if + pgrep babeld >/dev/null; then + lockfile="/tmp/fff-web-ui.babel.lock" + if [ -e $lockfile ] && [ 30 -gt $(( $(date +%s) - $(date -r $lockfile +%s) )) ] ; then + neighbours=$(cat /tmp/fff-web-ui.babel) + else + neighbours="$(echo dump | nc ::1 33123 | grep '^add neighbour' | + awk '{ + for (i=2; i < NF; i += 2) { + vars[$i] = $(i+1) + } + } + { + printf "", vars["address"], vars["if"], vars["cost"] + }')" + echo "$neighbours" > /tmp/fff-web-ui.babel + touch $lockfile + fi + fi + echo -n "$neighbours" + %> +
IPInterfaceKosten
%s%s%s
%s%s%s
+
+ <% fi %>