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

Fix check when modemamanger is used in tracking

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-04-12 15:15:30 +02:00
parent 60619fa41d
commit 55cf813698

View file

@ -746,7 +746,8 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || ([ "$OMR_TRACKER_INTERFACE" != "omrvpn
modemfind="0"
for modem in $(timeout 3 mmcli -L | awk -F/ '{ print $6}' | awk '{print $1}'); do
modeminfo="$(timeout 2 mmcli -m $modem -K)"
if [ -n "$(echo $modeminfo | grep $OMR_TRACKER_DEVICE)" ]; then
device="$(uci -q get network.$OMR_TRACKER_INTERFACE.device)"
if [ -n "$(echo $modeminfo | grep $device)" ]; then
modemfind="1"
if [ -n "$(echo $modeminfo | grep 'modem.generic.state ' | grep failed)" ] && [ -n "$(echo $modeminfo | grep 'modem.generic.state-failed-reason' | grep 'unknown-capabilities')" ]; then
_log "Interface $OMR_TRACKER_INTERFACE in failed state in ModemManager, reset modem..."