rewrite json_get_vars to jsonfilter
This commit is contained in:
parent
f449e31298
commit
d1110f3cdc
@ -1,22 +1,18 @@
|
||||
#!/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"
|
||||
ifstatus client "$1"|jsonfilter -e "@.device"
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
ifup)
|
||||
DEVICE="$(ifname_to_dev "$INTERFACE")"
|
||||
|
||||
[ "$DEVICE" == $(cat /lib/gluon/respondd/client.dev) ] &&
|
||||
[ "$DEVICE" != "$(cat /lib/gluon/respondd/client.dev)" ] ||
|
||||
/etc/init.d/gluon-respondd restart_if_running &
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user