From 5e469157a1f1734365b11fbdc846d26a93e6d4eb Mon Sep 17 00:00:00 2001 From: Josh Boyd Date: Tue, 5 May 2015 12:34:09 -0400 Subject: [PATCH] Replace poweroff call with magic command reboot rather than waiting for filesystem syncing and services to shut down gracefully. --- usbkill.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usbkill.py b/usbkill.py index 6747715..7994ff2 100644 --- a/usbkill.py +++ b/usbkill.py @@ -53,7 +53,8 @@ def kill_computer(): os.system("shutdown -r now") else: # Linux - os.system("poweroff -f") + os.system("echo 1 > /proc/sys/kernel/sysrq") + os.system("echo b > /proc/sysrq-trigger") def lsusb(): # A python version of the command 'lsusb' that returns a list of connected usbids