From fd9ede48313b3df4065ec7167bf3b3a7e14d843c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Desobediente=20Tecnol=C3=B3gico?= <52879067+DesobedienteTecnologico@users.noreply.github.com> Date: Fri, 10 Jun 2022 00:20:22 +0300 Subject: [PATCH] Restart and Poweroff working for SeedSignerOS --- src/seedsigner/views/view.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/seedsigner/views/view.py b/src/seedsigner/views/view.py index 815e5932..463cf8c1 100644 --- a/src/seedsigner/views/view.py +++ b/src/seedsigner/views/view.py @@ -188,10 +188,9 @@ class RestartView(View): # exiting. time.sleep(0.25) - # Kill the SeedSigner process; systemd will automatically restart it. - # `.*` is a wildcard to detect either `python`` or `python3` and with or - # without the `-u` flag. - call("kill $(ps aux | grep '[p]ython.*main.py' | awk '{print $2}')", shell=True) + # Kill the SeedSigner process; Running the process again. + # `.*` is a wildcard to detect either `python`` or `python3`. + call("kill $(pidof python*) & python /opt/src/main.py", shell=True) @@ -208,7 +207,7 @@ class PowerOffView(View): from subprocess import call while self.keep_running: time.sleep(5) - call("sudo shutdown --poweroff now", shell=True) + call("poweroff", shell=True) @@ -243,4 +242,4 @@ class UnhandledExceptionView(View): allow_text_overflow=True, # Fit what we can, let the rest go off the edges ).display() - return Destination(MainMenuView, clear_history=True) \ No newline at end of file + return Destination(MainMenuView, clear_history=True)