From 7b1ebb56af1787acbb7d42267bdabfe8b3b6170a Mon Sep 17 00:00:00 2001 From: AGobron <42329059+AGobron@users.noreply.github.com> Date: Sun, 12 Aug 2018 21:49:22 -0400 Subject: [PATCH] fix shutdown/reboot script Hi, I noticed that the script will not shutdown/reboot the pi if emulationstation isn't running. Here's a change that fixed it for mine. --- SafeShutdown.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SafeShutdown.py b/SafeShutdown.py index 7d6393b..8e4d757 100644 --- a/SafeShutdown.py +++ b/SafeShutdown.py @@ -16,11 +16,13 @@ #functions that handle button events def when_pressed(): led.blink(.2,.2) - os.system("sudo killall emulationstation && sleep 5s && sudo shutdown -h now") + os.system("sudo killall emulationstation") + os.system("sleep 5s && sudo shutdown -h now") def when_released(): led.on() def reboot(): - os.system("sudo killall emulationstation && sleep 5s && sudo reboot") + os.system("sudo killall emulationstation") + os.system("sleep 5s && sudo reboot") btn = Button(powerPin, hold_time=hold) rebootBtn = Button(resetPin)