mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix failover
This commit is contained in:
parent
5198aa358f
commit
a878729b22
1 changed files with 5 additions and 5 deletions
|
@ -5,9 +5,9 @@ set_route() {
|
||||||
local multipath_config interface_gw interface_if
|
local multipath_config interface_gw interface_if
|
||||||
INTERFACE=$1
|
INTERFACE=$1
|
||||||
multipath_config=$(uci -q get "network.$INTERFACE.multipath" || echo "off")
|
multipath_config=$(uci -q get "network.$INTERFACE.multipath" || echo "off")
|
||||||
#multipath_current_config=$(multipath $INTERFACE | grep deactivated)
|
multipath_current_config=$(multipath $INTERFACE | grep deactivated)
|
||||||
#if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$multipath_current_config" = "" ]; then
|
if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$multipath_current_config" = "" ]; then
|
||||||
if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ]; then
|
#if [ "$multipath_config" != "off" ] && [ "$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")
|
||||||
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
|
||||||
|
@ -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
|
# An interface in error will never be used in MPTCP
|
||||||
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
|
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
|
||||||
[ "$multipath_status" = "off" ] && exit 0
|
#[ "$multipath_status" = "off" ] && exit 0
|
||||||
_log "$OMR_TRACKER_DEVICE switched off"
|
#_log "$OMR_TRACKER_DEVICE switched off"
|
||||||
multipath "$OMR_TRACKER_DEVICE" off
|
multipath "$OMR_TRACKER_DEVICE" off
|
||||||
if [ "$default_gw" = "$current_interface_gw" ] || [ "$default_gw" = "" ]; then
|
if [ "$default_gw" = "$current_interface_gw" ] || [ "$default_gw" = "" ]; then
|
||||||
config_load network
|
config_load network
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue