wait for modem for a bit when it is not immediately available yet (e.g. after crust wakeup)
This commit is contained in:
parent
1608ab1ae4
commit
24f8ed8478
1 changed files with 13 additions and 3 deletions
|
@ -16,9 +16,19 @@ gracefulexit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
modem_n() {
|
modem_n() {
|
||||||
MODEMS="$(mmcli -L)"
|
TRIES=0
|
||||||
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is your modem enabled?\nDisabling modem monitor"
|
while [ "$TRIES" -lt 10 ]; do
|
||||||
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
|
MODEMS="$(mmcli -L)"
|
||||||
|
if ! echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null; then
|
||||||
|
TRIES=$((TRIES+1))
|
||||||
|
echo "sxmo_modemmonitor: modem not found, waiting for modem... (try #$TRIES)">&2
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
err "Couldn't find modem - is your modem enabled? Disabling modem monitor"
|
||||||
}
|
}
|
||||||
|
|
||||||
lookupnumberfromcallid() {
|
lookupnumberfromcallid() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue