mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +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,9 +12,11 @@ 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")
|
||||||
|
if [ "$interface_gw" != "" ]; then
|
||||||
_log "Replace default route by $interface_gw dev $interface_if"
|
_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
|
ip route replace default scope global nexthop via $interface_gw dev $interface_if && SETROUTE=true
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep `expr $RANDOM % 10`
|
sleep `expr $RANDOM % 10`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue