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 <tim.niemeyer@mastersword.de>
This commit is contained in:
Tim Niemeyer 2012-12-09 18:51:29 +01:00
parent 2083df18d1
commit a7e79f3adf
1 changed files with 2 additions and 2 deletions

View File

@ -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_$count><originator>$originator</originator><link_quality>$link_quality</link_quality><nexthop>$nexthop</nexthop><last_seen>$last_seen</last_seen><outgoing_interface>$outgoing_interface</outgoing_interface></originator_$count>"