Add 'check-reboot-modem.sh'
This commit is contained in:
parent
16fbf5dc41
commit
492f2b41f6
21
check-reboot-modem.sh
Normal file
21
check-reboot-modem.sh
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# A script to check the modem is still there and reboot it if not.
|
||||||
|
# From: https://www.reddit.com/r/PinePhoneOfficial/comments/pldi68/after_1_week_with_pinephone_battery_life_and_sim/hcajlhn?utm_source=share&utm_medium=web2x&context=3
|
||||||
|
|
||||||
|
DELAY=60
|
||||||
|
|
||||||
|
st=$(lsusb | grep Quectel)
|
||||||
|
if test "x$st" = "x"
|
||||||
|
then
|
||||||
|
echo "Modem not found, rechecking in $DELAY s."
|
||||||
|
sleep $DELAY
|
||||||
|
st=$(lsusb | grep Quectel)
|
||||||
|
if test "x$st" = "x"
|
||||||
|
then
|
||||||
|
echo "Modem not auto-restored by system; restarting eg25-manager."
|
||||||
|
systemctl restart eg25-manager
|
||||||
|
else
|
||||||
|
echo "Modem was auto-restored by system."
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user