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

Restart ModemManager if it doesn't answer

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-05-23 10:07:14 +02:00
parent 9d89ac896f
commit 7f695c77ba

View file

@ -101,6 +101,10 @@ if [ -z "$(pgrep ModemManager)" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(
_log "Can't find ModemManager, restart it..."
/etc/init.d/modemmanager restart 2>&1 >/dev/null
sleep 5
elif [ -n "$(pgrep ModemManager)" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(uci -q show network | grep modemmanager)" ] && [ -z "$(timeout 2 mmcli -L)" ]; then
_log "ModemManager doesn't answer, restart it..."
/etc/init.d/modemmanager restart 2>&1 >/dev/null
sleep 5
#elif [ -n "$(pgrep ModemManager)" ] && [ -f /etc/init.d/modemmanager ] && [ -z "$(uci -q show network | grep modemmanager)" ]; then
# _log "ModemManager not used, stop it..."
# /etc/init.d/modemmanager stop 2>&1 >/dev/null