From 700831d3b520c08cf6ad70427a7ffc2a00d6d6b7 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Sun, 25 Oct 2015 16:26:27 +0100 Subject: [PATCH] bsp/default: nodewatcher: use bridge from iproute2 brctl isn't part of OpenWRT anymore. Rewrite the client-count to bridge util from iproute2 package. Another alternative may be to use "batctl tl" but there we get false positives for local interfaces. Signed-off-by: Tim Niemeyer Reviewed-by: Steffen Pankratz --- bsp/default/root_file_system/etc/nodewatcher.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bsp/default/root_file_system/etc/nodewatcher.sh b/bsp/default/root_file_system/etc/nodewatcher.sh index 8db5106d..6083225d 100755 --- a/bsp/default/root_file_system/etc/nodewatcher.sh +++ b/bsp/default/root_file_system/etc/nodewatcher.sh @@ -2,7 +2,7 @@ # Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg # License; GPL v3 -SCRIPT_VERSION="33" +SCRIPT_VERSION="34" test -f /tmp/started || exit @@ -205,13 +205,11 @@ crawl() { fi err "`date`: Collecting information about conected clients" #CLIENTS - SEDDEV=$(brctl showstp $MESH_INTERFACE | awk '/\([0-9]\)/ { - sub("\\(", "", $0) - sub("\\)", "", $0) - print "s/^ "$2"/"$1"/;" - }') - - client_count=$(brctl showmacs $MESH_INTERFACE | sed -e "$SEDDEV" | egrep -c "(${CLIENT_INTERFACES// /|}).*no") + client_count=0 + for clientif in ${CLIENT_INTERFACES}; do + local cc=$(bridge fdb show br $MESH_INTERFACE brport $clientif | grep -v self | grep -v permanent -c) + client_count=$((client_count + $cc)) + done err "`date`: Putting all information into a XML-File and save it at "$SCRIPT_DATA_FILE