mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Fix ModemManager restart loop
This commit is contained in:
parent
47ac658fd4
commit
1101daba60
1 changed files with 12 additions and 11 deletions
|
@ -736,17 +736,18 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
|||
_log "Set $OMR_TRACKER_INTERFACE up"
|
||||
ifup $OMR_TRACKER_INTERFACE
|
||||
sleep 20
|
||||
elif [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(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 answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart associed interface $modem_interface"
|
||||
ifup $modem_interface
|
||||
}
|
||||
fi
|
||||
done
|
||||
#elif [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(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 answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart associed interface $modem_interface"
|
||||
# ifup $modem_interface
|
||||
# sleep 30
|
||||
# }
|
||||
# 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)
|
||||
|
|
Loading…
Reference in a new issue