mirror of
https://github.com/srlabs/blue-merle.git
synced 2024-12-22 05:44:59 -05:00
blue-merle: Fixes shutdown
This commit is contained in:
parent
5d8efbb4e3
commit
b97c0f06eb
@ -121,7 +121,7 @@ case $answer in
|
|||||||
esac
|
esac
|
||||||
if [[ "$answer" -eq 1 ]]; then
|
if [[ "$answer" -eq 1 ]]; then
|
||||||
echo '{ "msg": "Shutting down..." }' > /dev/ttyS0
|
echo '{ "msg": "Shutting down..." }' > /dev/ttyS0
|
||||||
halt -d 5
|
echo '{ "poweroff": "1" }' > /dev/ttyS0
|
||||||
else
|
else
|
||||||
echo "Resetting modem..."
|
echo "Resetting modem..."
|
||||||
until gl_modem AT AT+QPOWD | grep -q OK
|
until gl_modem AT AT+QPOWD | grep -q OK
|
||||||
|
@ -61,11 +61,14 @@ sleep 5
|
|||||||
|
|
||||||
|
|
||||||
i=5
|
i=5
|
||||||
/sbin/poweroff -d $i
|
|
||||||
until [[ $i -eq 0 ]]
|
until [[ $i -eq 0 ]]
|
||||||
do
|
do
|
||||||
i=$((i-1))
|
i=$((i-1))
|
||||||
mcu_send_message "Shutting down... ($i)"
|
mcu_send_message "Shutting down... ($i)"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
logger -p notice -t blue-merle-toggle "Finished with Stage 2"
|
logger -p notice -t blue-merle-toggle "Finished with Stage 2"
|
||||||
|
|
||||||
|
# Note: calling /sbin/poweroff directly results in the device rebooting into a broken state
|
||||||
|
echo '{ "poweroff": "1" }' >/dev/ttyS0
|
||||||
|
@ -34,11 +34,10 @@ elif [ "$1" == "shutdown-modem" ]; then
|
|||||||
exec gl_modem AT AT+CFUN=4
|
exec gl_modem AT AT+CFUN=4
|
||||||
|
|
||||||
elif [ "$1" == "shutdown" ]; then
|
elif [ "$1" == "shutdown" ]; then
|
||||||
echo '{ "msg": "Shutdowing down..." }' > /dev/ttyS0
|
show_message "Shutting down..."
|
||||||
halt -d 5
|
|
||||||
echo -n "Shutting down"
|
echo -n "Shutting down"
|
||||||
poweroff -d 5
|
|
||||||
logger -p notice -t blue-merle-libexec "Shutting down"
|
logger -p notice -t blue-merle-libexec "Shutting down"
|
||||||
|
echo '{ "poweroff": "1" } > /dev/ttyS0
|
||||||
|
|
||||||
elif [ "$1" == "write-imei" ]; then
|
elif [ "$1" == "write-imei" ]; then
|
||||||
new_imei=$2
|
new_imei=$2
|
||||||
|
Loading…
Reference in New Issue
Block a user