package/freifunk-common: neigh.sh use olsr-jsoninfo
This commit is contained in:
parent
0c1f8b8aa3
commit
d5cd72e011
1 changed files with 20 additions and 2 deletions
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
wget -q -O - http://localhost:2006/neighbours|sed -e's/LinkQuality/LQ/;s/Hysteresis/Hyst./;s/Willingness/Will./'
|
. /usr/share/libubox/jshn.sh
|
||||||
[ -f /proc/net/ipv6_route ] && wget -q -O - http://[::1]:2006/neighbours|sed -e's/LinkQuality/LQ/;s/Hysteresis/Hyst./;s/Willingness/Will./'
|
|
||||||
|
for HOST in 127.0.0.1 ::1;do
|
||||||
|
json_init
|
||||||
|
json_load "$(echo /links|nc ${HOST} 9090)"
|
||||||
|
if json_is_a links array;then
|
||||||
|
echo "LocalIP RemoteIP vTime LQ NLQ Cost"
|
||||||
|
json_select links
|
||||||
|
i=1
|
||||||
|
while json_is_a ${i} object;do
|
||||||
|
json_select ${i}
|
||||||
|
json_get_vars localIP remoteIP validityTime linkQuality neighborLinkQuality linkCost
|
||||||
|
echo "${localIP} ${remoteIP} ${validityTime} ${linkQuality} ${neighborLinkQuality} ${linkCost}"
|
||||||
|
json_select
|
||||||
|
i=$(( i + 1 ))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue