From 2698e4564e9e6315c128e0e134aa5ee930f73aca Mon Sep 17 00:00:00 2001 From: piotr Date: Wed, 1 Nov 2023 22:54:08 +0100 Subject: [PATCH] force reboot if systemctl available --- nwg_shell/installer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nwg_shell/installer.py b/nwg_shell/installer.py index 3d664c6..0e91cfb 100644 --- a/nwg_shell/installer.py +++ b/nwg_shell/installer.py @@ -306,7 +306,10 @@ def main(): else: print("Your computer will now restart...") time.sleep(3) - subprocess.call("sudo reboot", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) + if is_command("systemctl"): + subprocess.call("sudo systemctl reboot -f", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) + else: + subprocess.call("sudo reboot", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) if __name__ == '__main__':