diff --git a/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/home.html index 4b778eae..bc808e1d 100755 --- a/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/home.html +++ b/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/home.html @@ -96,6 +96,35 @@ fi Bekannte Knoten:<%= $(($(batctl tg -H | cut -b 40-56 | sort | uniq | wc -l 2>/dev/null)+1)) %> Nachbarknoten:<%= $(batctl o -H | cut -b 40-56 | sort | uniq | wc -l 2>/dev/null) %> <% fi %> + <% if birdc show status >/dev/null 2>&1 || pgrep babeld >/dev/null; then %> + + + <% 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 %>