From 18d956bd74d793e02a3ae6c49b75d6b0fcc9f5f8 Mon Sep 17 00:00:00 2001 From: floh1111 Date: Sun, 14 Aug 2011 12:18:23 +0000 Subject: [PATCH] Fixed array counting of originators --- root_file_system/default/etc/nodewatcher.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/root_file_system/default/etc/nodewatcher.sh b/root_file_system/default/etc/nodewatcher.sh index b75df3f2..095b490d 100755 --- a/root_file_system/default/etc/nodewatcher.sh +++ b/root_file_system/default/etc/nodewatcher.sh @@ -271,6 +271,7 @@ crawl() { IFS=" " BAT_ADV_ORIGINATORS=`batctl o | awk '/O/ {next} /B/ {next} {print}'` + count=0; for row in $BAT_ADV_ORIGINATORS; do originator=`echo $row | awk '{print $1}'` last_seen=`echo $row | awk '{print $2}'` @@ -279,7 +280,8 @@ crawl() { link_quality="${link_quality//(/}" link_quality="${link_quality//)/}" - batman_adv_originators=$batman_adv_originators"$originator$link_quality$last_seen" + batman_adv_originators=$batman_adv_originators"$originator$link_quality$last_seen" + count=$[$count+1] done IFS=$OLDIFS fi