better sysrq test

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2016-03-26 17:52:27 +03:00
parent 409f6f8cd2
commit 04ff160a7d

2
rc.in
View File

@ -132,7 +132,7 @@ rc.halt() {
if type -P halt; then
function rc.halt_poweroff { halt -p; }
function rc.halt_reboot { halt -r; }
elif [[ -f /proc/sysrq-trigger ]]; then
elif (( $(</proc/sys/kernel/sysrq) )); then
function rc.halt_poweroff { echo 'o' > /proc/sysrq-trigger; }
function rc.halt_reboot { echo 'b' > /proc/sysrq-trigger; }
else