the mesh-package provides the information on which device respondd should be running besides mesh-interfaces

This commit is contained in:
Christof Schulze 2016-12-02 12:21:03 +01:00
parent 8dfa61af2d
commit f449e31298
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1 @@
br-client

View File

@ -0,0 +1,22 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions/service.sh
DEVLIST=/var/run/gluon-respondd.devs
ifname_to_dev () {
json_load "$(ubus call network.interface.$1 status)"
json_get_var dev device
echo "$dev"
}
case "$ACTION" in
ifup)
DEVICE="$(ifname_to_dev "$INTERFACE")"
[ "$DEVICE" == $(cat /lib/gluon/respondd/client.dev) ] &&
/etc/init.d/gluon-respondd restart_if_running &
;;
esac

View File

@ -13,7 +13,7 @@ LOCK=/var/run/gluon-respondd.lock
do_start() {
DEVS=""
for dev in $( ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device") br-client
for dev in $( ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device") $(cat /lib/gluon/respondd/client.dev)
do
DEVS="$DEVS -i $dev"
done