mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
net/mwan3: add ubus interface check
On interfaces with interface proto "qmi|ncm" and option dhcp enabled the interface will be changed to $iface_4 | $iface_6. The interface mapping in mwan3 will not recognize this interface. To fix this issue an ubus call will check if an upper interface exists. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -22,15 +22,24 @@ fi
|
||||
[ -x /usr/sbin/ip6tables ] || exit 7
|
||||
[ -x /usr/bin/logger ] || exit 8
|
||||
|
||||
config_get family $INTERFACE family ipv4
|
||||
|
||||
if [ "$family" == "ipv4" ]; then
|
||||
network_get_gateway gateway $INTERFACE
|
||||
elif [ "$family" == "ipv6" ]; then
|
||||
network_get_gateway6 gateway $INTERFACE
|
||||
fi
|
||||
|
||||
if [ "$ACTION" == "ifup" ]; then
|
||||
config_get family $INTERFACE family ipv4
|
||||
if [ "$family" = "ipv4" ]; then
|
||||
ubus call network.interface.${INTERFACE}_4 status &>/dev/null
|
||||
if [ "$?" -eq "0" ]; then
|
||||
network_get_gateway gateway ${INTERFACE}_4
|
||||
else
|
||||
network_get_gateway gateway $INTERFACE
|
||||
fi
|
||||
elif [ "$family" = "ipv6" ]; then
|
||||
ubus call network.interface.${INTERFACE}_6 status &>/dev/null
|
||||
if [ "$?" -eq "0" ]; then
|
||||
network_get_gateway6 gateway ${INTERFACE}_6
|
||||
else
|
||||
network_get_gateway6 gateway ${INTERFACE}
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "$gateway" ] || exit 9
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user