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

Put correct interface state in omr-tracker post-tracking error and up scripts

This commit is contained in:
Ycarus (Yannick Chabanois) 2025-02-14 15:15:12 +01:00
parent c143a6bdc2
commit 6f54d07fcb
2 changed files with 13 additions and 2 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
# Copyright (C) 2018-2025 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -12,6 +12,11 @@ interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e
. /usr/share/omr/lib/common-post-tracking.sh
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state)" != "down" ]; then
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state='down'
uci -q commit openmptcprouter
fi
# An interface in error will never be used in MPTCP
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || { [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$interface_up" != "true" ]; }; then
#interface_autostart=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["autostart"]')

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
# Copyright (C) 2018-2025 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -48,6 +48,12 @@ default_gw6=$(ip -6 route get 2606:4700:4700::1111 | grep via | awk '{print $3}'
initcwrwnd=""
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state)" != "up" ]; then
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state='up'
uci -q commit openmptcprouter
fi
if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] || [ "$OMR_TRACKER_INTERFACE" = "omr6in4" ]; then
if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
uci -q set openmptcprouter.omr.vpn='up'