@ -26,24 +26,20 @@ if [ "$ACTION" == "ifup" ]; then
if [ "$family" = "ipv4" ]; then
if [ "$family" = "ipv4" ]; then
ubus call network.interface.${INTERFACE}_4 status &>/dev/null
ubus call network.interface.${INTERFACE}_4 status &>/dev/null
if [ "$?" -eq "0" ]; then
if [ "$?" -eq "0" ]; then
network_get_gateway gateway ${INTERFACE}_4
network_get_ipaddr src_ip ${INTERFACE}_4
network_get_ipaddr src_ip ${INTERFACE}_4
else
else
network_get_gateway gateway $INTERFACE
network_get_ipaddr src_ip ${INTERFACE}
network_get_ipaddr src_ip ${INTERFACE}
fi
fi
elif [ "$family" = "ipv6" ]; then
elif [ "$family" = "ipv6" ]; then
ubus call network.interface.${INTERFACE}_6 status &>/dev/null
ubus call network.interface.${INTERFACE}_6 status &>/dev/null
if [ "$?" -eq "0" ]; then
if [ "$?" -eq "0" ]; then
network_get_gateway6 gateway ${INTERFACE}_6
network_get_ipaddr6 src_ip ${INTERFACE}_6
network_get_ipaddr6 src_ip ${INTERFACE}_6
else
else
network_get_gateway6 gateway ${INTERFACE}
network_get_ipaddr6 src_ip ${INTERFACE}
network_get_ipaddr6 src_ip ${INTERFACE}
fi
fi
fi
fi
[ -n "$gateway " ] || exit 9
[ -n "$src_ip " ] || exit 9
fi
fi
if [ "$initial_state" = "offline" ]; then
if [ "$initial_state" = "offline" ]; then