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

Check Multipath support every 10 minutes

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-10-03 11:45:05 +02:00
parent ca25b1c23c
commit ffbd7bbd72

View file

@ -159,10 +159,10 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$(uci -q get openmptcprouter.$OMR_TRA
}
config_load openmptcprouter
config_foreach traceboxmtutest server
[ "$(uci -q get openmptcprouter.settings.tracebox)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE" ] && {
mptcpsupport="$(omr-mptcp-intf $OMR_TRACKER_DEVICE)"
[ -n "$mptcpsupport" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$mptcpsupport"
}
# [ "$(uci -q get openmptcprouter.settings.tracebox)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE" ] && {
# mptcpsupport="$(omr-mptcp-intf $OMR_TRACKER_DEVICE)"
# [ -n "$mptcpsupport" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$mptcpsupport"
# }
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state='up'
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
}
@ -277,5 +277,16 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$(uci -q get openmptcprouter.$OMR_TRA
fi
#dns_flush
fi
if [ "$(uci -q get openmptcprouter.settings.tracebox)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && { [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.mplc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.mplc))) -gt 600 ]; }; then
#_log "Get MPTCP status for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE)"
mptcpsupport="$(omr-mptcp-intf $OMR_TRACKER_DEVICE)"
#_log "MPTCP status for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE): $mptcpsupport"
[ -n "$mptcpsupport" ] && [ "$(uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status)" != "$mptcpsupport" ] && {
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$mptcpsupport"
uci -q commit openmptcprouter
}
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mplc=$(date +"%s")
uci -q commit openmptcprouter
fi
exit 0