X-Git-Url: http://git.openwrt.org/?p=feed%2Frouting.git;a=blobdiff_plain;f=luci-app-bmx6%2Fbmx6%2Fwww%2Fcgi-bin%2Fbmx6-info;fp=luci-app-bmx6%2Fbmx6%2Fwww%2Fcgi-bin%2Fbmx6-info;h=ceebbbb37264c941d1c761e6edbf5278bd9412b0;hp=9c615e456893643f111e59d905159da1ad1b3f58;hb=2cc3c50bed41bcbbbbfaffb85b2b98d0f1dad04e;hpb=9bc518e8c80a319c85ea7f85a5d1a5bdb1349daa diff --git a/luci-app-bmx6/bmx6/www/cgi-bin/bmx6-info b/luci-app-bmx6/bmx6/www/cgi-bin/bmx6-info index 9c615e4..ceebbbb 100755 --- a/luci-app-bmx6/bmx6/www/cgi-bin/bmx6-info +++ b/luci-app-bmx6/bmx6/www/cgi-bin/bmx6-info @@ -43,7 +43,7 @@ print_query() { i=$(( $i + 1 )) done echo -n " ] }" - + # If /all has been specified, printing all the files together } || { comma="" @@ -77,7 +77,7 @@ if [ "$QUERY" == 'myself' ]; then echo -n "{\"myself\":{\"hostname\":\"$hostname\",\"ip6\":\"$ip6\",\"ip4\":\"$ip4\",\"net6\":\"$cidr6\",\"net4\":\"$cidr4\"}}" exit 0 fi - + if [ "$QUERY" == 'info' ]; then echo -n '{ "info": [ ' print_query status @@ -100,7 +100,12 @@ if [ "$QUERY" == 'neighbours' ]; then fi if [ "$QUERY" == 'tunnels' ]; then - bmx6 -c --jshow tunnels /r=0 + tunnels=$(bmx6 -c --jshow tunnels /r=0) + if [ -z $tunnels ]; then + echo '{ "tunnels" : [] }' + else + echo $tunnels + fi exit 0 fi