gluon-core, gluon-status-page, gluon-l3roamd: introduce script gluon-list-mesh-ifs that lists all currently active mesh interfaces
This commit is contained in:
parent
e40f7bf92d
commit
e015999da0
2
package/gluon-core/files/usr/bin/gluon-list-mesh-interfaces
Executable file
2
package/gluon-core/files/usr/bin/gluon-list-mesh-interfaces
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device"
|
@ -10,7 +10,7 @@ start_service () {
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn ${respawn_threshold:-3660} ${respawn_timeout:-5} ${respawn_retry:-0}
|
||||
interfaces=$(for dev in $( ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device");do echo " -m $dev"; done;
|
||||
interfaces=$(for dev in $(gluon-list-mesh-interfaces);do echo " -m $dev"; done;
|
||||
[ "$(ifstatus client | jsonfilter -e "@.up")" = "true" ] && echo " -i local-node")
|
||||
procd_set_param command "$PROG" -s /var/run/l3roamd.sock -p $(lua -e 'print(require("gluon.site").prefix6())') $interfaces -t 254 -a $(uci get network.loopback.ip6addr | cut -d/ -f1) -4 0:0:0:0:0:ffff::/96 -b br-client
|
||||
procd_close_instance
|
||||
|
@ -6,6 +6,6 @@ badrequest() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
( ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device"| grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
( gluon-list-mesh-interfaces | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
|
||||
exec /usr/bin/gluon-neighbour-info -s neighbour -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo
|
||||
|
@ -6,7 +6,7 @@ badrequest() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
( ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device"| grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
( gluon-list-mesh-interfaces | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
|
||||
CMD="exec /lib/gluon/status-page/providers/stations '$QUERY_STRING'"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user