mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 11:01:50 +00:00
Check multipath is enabled before apply status
This commit is contained in:
parent
1569e0b318
commit
ea91a88577
1 changed files with 8 additions and 3 deletions
|
@ -91,7 +91,9 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
|
||||||
if [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
|
if [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
|
||||||
[ "$multipath_status" = "off" ] || {
|
[ "$multipath_status" = "off" ] || {
|
||||||
_log "$OMR_TRACKER_DEVICE switched off"
|
_log "$OMR_TRACKER_DEVICE switched off"
|
||||||
multipath "$OMR_TRACKER_DEVICE" off
|
if [ "$(sysctl -n net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ]; then
|
||||||
|
multipath "$OMR_TRACKER_DEVICE" off
|
||||||
|
fi
|
||||||
glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 down > /dev/null 2>&1
|
glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 down > /dev/null 2>&1
|
||||||
config_load shadowsocks-libev
|
config_load shadowsocks-libev
|
||||||
config_foreach del_ss_route server
|
config_foreach del_ss_route server
|
||||||
|
@ -145,8 +147,11 @@ if [ "$(uci -q get omr-bypass.defaults.ifname)" = "$OMR_TRACKER_DEVICE" ] && [ "
|
||||||
ip route replace default via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE table 991337
|
ip route replace default via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE table 991337
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
[ "$multipath_config" = "on" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 up > /dev/null 2>&1
|
[ "$multipath_config" = "on" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 up > /dev/null 2>&1
|
||||||
[ "$multipath_config" = "backup" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 backup > /dev/null 2>&1
|
[ "$multipath_config" = "backup" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 backup > /dev/null 2>&1
|
||||||
[ "$multipath_status" = "$multipath_config" ] && exit 0
|
[ "$multipath_status" = "$multipath_config" ] && exit 0
|
||||||
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
if [ "$(sysctl -n net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ]; then
|
||||||
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
||||||
|
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue