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:
parent
aaea43b358
commit
bd80d0967f
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue