diff --git a/src/seedsigner/views/view.py b/src/seedsigner/views/view.py index 41199df5..50b1c40a 100644 --- a/src/seedsigner/views/view.py +++ b/src/seedsigner/views/view.py @@ -5,7 +5,7 @@ from seedsigner.gui.components import FontAwesomeIconConstants, GUIConstants from seedsigner.gui.screens import RET_CODE__POWER_BUTTON from seedsigner.gui.screens.screen import RET_CODE__BACK_BUTTON, DireWarningScreen, LargeButtonScreen, PowerOffScreen, ResetScreen, WarningScreen from seedsigner.models.threads import BaseThread - +from seedsigner.models import Settings class BackStackView: @@ -190,7 +190,10 @@ class RestartView(View): # 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) + if Settings.HOSTNAME == Settings.SEEDSIGNER_OS: + call("kill $(pidof python*) & python /opt/src/main.py", shell=True) + else: + call("kill $(ps aux | grep '[p]ython.*main.py' | awk '{print $2}')", shell=True) @@ -207,7 +210,13 @@ class PowerOffView(View): from subprocess import call while self.keep_running: time.sleep(5) - call("poweroff", shell=True) + if Settings.HOSTNAME == Settings.SEEDSIGNER_OS: + # disable microsd detection before shutdown to prevent display of toast notification during shutdown + from seedsigner.controller import Controller + Controller.get_instance().microsd.stop() + call("poweroff", shell=True) + else: + call("sudo shutdown --poweroff now", shell=True)