mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
net/mwan3: execute only ifup event if l3_device is found
Only execute an ifup event with the command "mwan3 ifup <iface>" if the l3_device is found in the ubus "network.interface.<iface>". Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
|
. /usr/share/libubox/jshn.sh
|
||||||
. /lib/functions/network.sh
|
. /lib/functions/network.sh
|
||||||
. /lib/mwan3/mwan3.sh
|
. /lib/mwan3/mwan3.sh
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ ifdown()
|
|||||||
|
|
||||||
ifup()
|
ifup()
|
||||||
{
|
{
|
||||||
local device enabled
|
local device enabled up l3_device
|
||||||
|
|
||||||
config_load mwan3
|
config_load mwan3
|
||||||
|
|
||||||
@@ -60,12 +61,14 @@ ifup()
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
json_load $(ubus -S call network.interface.$1 status)
|
||||||
|
json_get_vars up l3_device
|
||||||
config_get enabled "$1" enabled 0
|
config_get enabled "$1" enabled 0
|
||||||
|
|
||||||
device=$(uci -p /var/state get network.$1.ifname) &> /dev/null
|
if [ "$up" -eq 1 ] \
|
||||||
|
&& [ -n "$l3_device" ] \
|
||||||
if [ -n "$device" ] ; then
|
&& [ "$enabled" -eq 1 ]; then
|
||||||
[ "$enabled" -eq 1 ] && ACTION=ifup INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
|
ACTION=ifup INTERFACE=$1 DEVICE=$l3_device /sbin/hotplug-call iface
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user