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

Fix failover

This commit is contained in:
Ycarus 2018-02-15 09:33:27 +01:00
parent 5198aa358f
commit a878729b22

View file

@ -5,9 +5,9 @@ set_route() {
local multipath_config interface_gw interface_if
INTERFACE=$1
multipath_config=$(uci -q get "network.$INTERFACE.multipath" || echo "off")
#multipath_current_config=$(multipath $INTERFACE | grep deactivated)
#if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$multipath_current_config" = "" ]; then
if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ]; then
multipath_current_config=$(multipath $INTERFACE | grep deactivated)
if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$multipath_current_config" = "" ]; then
#if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ]; then
interface_gw=$(uci -q get "network.$INTERFACE.gateway")
interface_if=$(uci -q get "network.$INTERFACE.ifname")
ip route replace default scope global nexthop via $interface_gw dev $interface_if && SETROUTE=true
@ -28,8 +28,8 @@ current_interface_gw=$(uci -q get "network.$OMR_TRACKER_INTERFACE.gateway")
# An interface in error will never be used in MPTCP
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
[ "$multipath_status" = "off" ] && exit 0
_log "$OMR_TRACKER_DEVICE switched off"
#[ "$multipath_status" = "off" ] && exit 0
#_log "$OMR_TRACKER_DEVICE switched off"
multipath "$OMR_TRACKER_DEVICE" off
if [ "$default_gw" = "$current_interface_gw" ] || [ "$default_gw" = "" ]; then
config_load network