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

Various changes in OMR-Tracker for optimization

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-08-30 17:02:31 +02:00
parent da55fcb051
commit b1a4cc8783
7 changed files with 44 additions and 10 deletions

View file

@ -1,9 +1,20 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (C) 2018-2024 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.
#
# This script do commands when an interface is detected as up
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
exit 0
fi
if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && [ "$OMR_TRACKER_PREV_DEVICE_IP" = "$OMR_TRACKER_DEVICE_IP" ] && [ "$OMR_TRACKER_PREV_DEVICE_IP6" = "$OMR_TRACKER_DEVICE_IP6" ]; then
exit 0
fi
SETROUTE=false
. /lib/functions/network.sh
@ -196,7 +207,7 @@ set_routes_intf() {
local interface_if
local INTERFACE=$1
[ -z "$INTERFACE" ] && return
[ "$INTERFACE" = "omrvpn" ] && continue
[ "$INTERFACE" = "omrvpn" ] && return
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
@ -255,8 +266,8 @@ set_routes_intf6() {
local interface_if
local INTERFACE=$1
[ -z "$INTERFACE" ] && return
[ "$INTERFACE" = "omr6in4" ] && continue
[ "$INTERFACE" = "omrvpn" ] && continue
[ "$INTERFACE" = "omr6in4" ] && return
[ "$INTERFACE" = "omrvpn" ] && return
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
@ -1073,3 +1084,4 @@ fi
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
#ubus call network reload
exit 0