1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00

Check if gw is not empty for tracker

This commit is contained in:
Ycarus 2018-02-22 12:03:37 +01:00
parent aaea43b358
commit bd80d0967f

View file

@ -12,8 +12,10 @@ set_route() {
#if [ "$multipath_config" != "off" ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$SETROUTE" != true ]; then #if [ "$multipath_config" != "off" ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$SETROUTE" != true ]; then
interface_gw=$(uci -q get "network.$INTERFACE.gateway") interface_gw=$(uci -q get "network.$INTERFACE.gateway")
interface_if=$(uci -q get "network.$INTERFACE.ifname") interface_if=$(uci -q get "network.$INTERFACE.ifname")
_log "Replace default route by $interface_gw dev $interface_if" if [ "$interface_gw" != "" ]; then
ip route replace default scope global nexthop via $interface_gw dev $interface_if && SETROUTE=true _log "Replace default route by $interface_gw dev $interface_if"
ip route replace default scope global nexthop via $interface_gw dev $interface_if && SETROUTE=true
fi
fi fi
} }