no more loop in start_launcher after shutdown

This commit is contained in:
Vincent-FK
2021-01-11 18:51:26 +01:00
parent 8a62ff605e
commit c1fd9e55d6
5 changed files with 19 additions and 6 deletions

View File

@@ -1,5 +1,9 @@
#!/bin/sh
# Notify system, reboot in progress
REBOOTING_FILE="/run/rebooting"
touch $REBOOTING_FILE
# Notif fullscreen "Shutting down"
notif_set 0 "^^^^^^^^ SHUTTING DOWN...^^^^^^^^"
@@ -9,6 +13,7 @@ start_audio_amp 0 >/dev/null 2>&1
# Force Read Only
ro
# Unmount writeable partition to force
umount -r /mnt
# Poweroff

View File

@@ -6,6 +6,7 @@
LOCK_FILE="/var/lock/launcher.lock"
INSTANT_PLAY_FILE="/mnt/instant_play"
PREVENT_LAUNCHER_FILE="/mnt/prevent_launcher"
REBOOTING_FILE="/run/rebooting"
if [ -f "${LOCK_FILE}" ]; then
@@ -56,12 +57,19 @@ while true; do
wait $!
erase_pid
# Restart ampli audio if necessary
start_audio_amp 1 >/dev/null 2>&1
# In case retrofe quits with errors, clear graphic VT
termfix_all
fi
# WD to prevent 100% CPU
sleep 0.5
# Exit if console rebooting
if [ -f $REBOOTING_FILE ]; then
break
fi
done
# Remove lock file and exit
rm "${LOCK_FILE}"
exit 0