1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Set a setting when modem is up but doesn't work in OMR-Tracker post-tracking error & up script

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-09-16 08:08:28 +02:00
parent c9c2c4e269
commit f6df64a92b
2 changed files with 4 additions and 1 deletions

View file

@ -49,7 +49,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || { [ "$OMR_TRACKER_INTERFACE" != "omrvp
#mm_primary_port=$(modemmanager_get_field "${MODEM_STATUS}" "modem.generic.primary-port")
#mbimcli -p -d /dev/$mm_primary_port --ms-device-reset >/dev/null 2>&1
fi
elif [ "$mm_state" = "connected" ] || [ "$mm_state" = "enabled" ]; then
elif [ "$mm_state" = "enabled" ] || [ "$mm_state" = "connected" ]; then
_log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface"
_log "Set $OMR_TRACKER_INTERFACE down"
ifdown $OMR_TRACKER_INTERFACE
@ -57,6 +57,8 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || { [ "$OMR_TRACKER_INTERFACE" != "omrvp
_log "Set $OMR_TRACKER_INTERFACE up"
ifup $OMR_TRACKER_INTERFACE
sleep 30
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.restart_intf=1
uci -q commit openmptcprouter
elif [ "$mm_state" = "disabled" ]; then
# [ -n "$(echo $modeminfo | grep 'modem.3gpp.registration-state ' | grep home)" ]; then
_log "Interface $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) disabled, set it up"

View file

@ -837,6 +837,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACK
fi
exit 0
fi
uci -q del openmptcprouter.$OMR_TRACKER_INTERFACE.restart_intf
if [ "$OMR_TRACKER_PREV_STATUS" != "" ] && [ "$OMR_TRACKER_PREV_STATUS" != "$OMR_TRACKER_STATUS" ] && [ -n "$OMR_TRACKER_INTERFACE" ]; then
_log "$OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) switched up"