mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix modems connection for RUTX (and maybe some other cases)
This commit is contained in:
parent
90408a197a
commit
ff82abbb27
1 changed files with 17 additions and 0 deletions
|
@ -807,9 +807,24 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
|||
sleep 20
|
||||
fi
|
||||
|
||||
if [ "$interface_up" = "true" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "dhcp" ]; then
|
||||
for modem in $(mmcli -L | awk -F/ '{ print $6}' | awk '{print $1}'); do
|
||||
if [ -n "$(timeout 2 mmcli -m $modem -K | grep $OMR_TRACKER_DEVICE)" ]; then
|
||||
modem_device=$(mmcli -m $modem -K | grep 'modem.generic.device ' | awk '{print $3}')
|
||||
[ -n "$modem_device" ] && modem_interface=$(uci show network | grep $modem_device | awk -F. '{print $2}')
|
||||
[ -n "$modem_interface" ] && {
|
||||
_log "No anwser from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart associed interface $modem_interface"
|
||||
ifup $modem_interface
|
||||
}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# This part must be done after modems restart because we have no idea when modems will be ready again... (another solution would be to check ModemManager status)
|
||||
if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$multipath_status" != "off" ] || ([ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ]); then
|
||||
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
|
||||
_log "$OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) switched off"
|
||||
|
@ -910,6 +925,8 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
|||
config_load network
|
||||
config_foreach set_route interface $OMR_TRACKER_INTERFACE
|
||||
config_foreach set_route6 interface $OMR_TRACKER_INTERFACE
|
||||
else
|
||||
_log "Default gateway disabled, no default gateway set"
|
||||
fi
|
||||
if [ "$(uci -q get openmptcprouter.settings.shadowsocksudp)" = "1" ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get openmptcprouter.omr.shadowsocks)" = "up" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.redir_udp)" = "" ] && [ "$(uci -q get shadowsocks-libev.hi1.mode)" = "tcp_and_udp" ] && [ "$(uci -q get shadowsocks-libev.sss0.obfs)" != "1" ]; then
|
||||
_log "Tunnel down use ShadowSocks for UDP"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue