mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Check if multipath is enabled before doing something with it
This commit is contained in:
parent
6b789fd728
commit
b78f2340b2
3 changed files with 11 additions and 8 deletions
|
@ -722,7 +722,7 @@ dns_flush() {
|
|||
|
||||
# Get the current multipath status
|
||||
multipath_status="off"
|
||||
if [ -e "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
|
||||
if [ -e "/sys/class/net/$OMR_TRACKER_DEVICE" ] && [ "$(uci -q get network.globals.multipath)" = "enable" ]; then
|
||||
case "$(multipath "$OMR_TRACKER_DEVICE")" in
|
||||
*default*) multipath_status="on" ;;
|
||||
*backup*) multipath_status="backup" ;;
|
||||
|
@ -1054,7 +1054,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$multipath_config" = "on" ] || [ "$mu
|
|||
fi
|
||||
fi
|
||||
if [ "$(sysctl -qen net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ] || [ "$(sysctl -qen net.mptcp.enabled | tr -d '\n')" = "1" ]; then
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$(uci -q get network.globals.mptcp_force_multipath)" != "0" ] && {
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$(uci -q get network.globals.mptcp_force_multipath)" != "0" ] && [ "$(uci -q get network.globals.multipath)" = "enable" ] && {
|
||||
if [ "$multipath_status" = "$multipath_config" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv4)" != "$OMR_TRACKER_DEVICE_IP" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv6)" != "$OMR_TRACKER_DEVICE_IP6" ]); then
|
||||
_log "Local IP changed for $OMR_TRACKER_DEVICE ($OMR_TRACKER_INTERFACE) force Multipath"
|
||||
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue