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

Put back master as gateway only when needed

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-09-19 22:05:20 +02:00
parent 598377c2e9
commit 8e8de80285

View file

@ -372,7 +372,7 @@ multipath_config=$(uci -q get "network.$OMR_TRACKER_INTERFACE.multipath")
if [ "$multipath_config" = "master" ]; then if [ "$multipath_config" = "master" ]; then
if [ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]; then if [ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]; then
omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun") omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun")
if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | grep -v metric | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then
_log "Master up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE" _log "Master up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null