From a7e79f3adff31add5af93c35ffc33fabae7c8f44 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Sun, 9 Dec 2012 18:51:29 +0100 Subject: [PATCH] Nodewatcher: fix out interface detection Sometimes the interfaces have shorter names, then batctl adds some spaces just before the iface name. With cut we can get this right. Signed-off-by: Tim Niemeyer --- bsp/default/root_file_system/etc/nodewatcher.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/default/root_file_system/etc/nodewatcher.sh b/bsp/default/root_file_system/etc/nodewatcher.sh index 0e6644a..9c3e4f7 100755 --- a/bsp/default/root_file_system/etc/nodewatcher.sh +++ b/bsp/default/root_file_system/etc/nodewatcher.sh @@ -186,8 +186,8 @@ crawl() { last_seen=`echo $row | awk '{print $2}'` last_seen="${last_seen//s/}" link_quality=`echo $row | awk '{print $3}'` - outgoing_interface=`echo $row | awk '{print $6}'` - outgoing_interface="${outgoing_interface//]:/}" + outgoing_interface=`echo $row | cut -d] -f1 | cut -d[ -f2` + outgoing_interface="${outgoing_interface// /}" nexthop=`echo $row | awk '{print $4}'` batman_adv_originators=$batman_adv_originators"$originator$link_quality$nexthop$last_seen$outgoing_interface"