So, something like this to monitor both 4G connections to stop 2 wireless interfaces:
mob1status = $(ubus call network.interface.mob1s1a1 status | jq .up)
mob2status = $(ubus call network.interface.mob1s1a2 status | jq .up)
[ "$ACTION" == "ifdown" ] && {
[ "$INTERFACE" == "mob1s1a1" ] || [ "$INTERFACE" == "mobs1a2" ] && {
[ "$mob1status" == "false" ] && [ "$mob2status" == "false" ] && {
# both are down shutdown wifi
ubus call network.interface.wlan0 down
ubus call network.interface.wlan1 down
}
# at least one is up restart wifi
ubus call network.interface.wlan0 up
ubus call network.interface.wlan1 up
}
}
[ "$ACTION" == "ifup" ] && {
[ "$INTERFACE" == "mob1s1a1" ] || [ "$INTERFACE" == "mob1s1a2" ] && {
# one is up restart wifi
ubus call network.interface.wlan0 up
ubus call network.interface.wlan1 up
}
}