summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2022-09-07 19:49:38 +0000
committerSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2022-09-07 19:49:38 +0000
commit25ad7eef2cbe2b3431111f241d85658f57034df6 (patch)
treeacaa7bc6159d307cd848b68daeda1b17b6fa4dfc
parent79293e820d4bf25efd685fb43be78d52b7a093b1 (diff)
fshalt: optionally use /dev/pmctl to shut down the machine
-rwxr-xr-xrc/bin/fshalt3
-rw-r--r--sys/man/8/fshalt7
2 files changed, 7 insertions, 3 deletions
diff --git a/rc/bin/fshalt b/rc/bin/fshalt
index 53f3b7ca4..7b669aae4 100755
--- a/rc/bin/fshalt
+++ b/rc/bin/fshalt
@@ -80,6 +80,9 @@ fn x {
echo rebooting...
echo reboot $bootf >'#c/reboot'
}
+ if not if (test -e /dev/pmctl) {
+ echo power off >>/dev/pmctl
+ }
if (~ $scram yes){
scram
echo 'It''s now safe to turn off your computer'
diff --git a/sys/man/8/fshalt b/sys/man/8/fshalt
index d95ad52bb..78841cbc7 100644
--- a/sys/man/8/fshalt
+++ b/sys/man/8/fshalt
@@ -29,9 +29,10 @@ If given
will then reboot the machine,
optionally starting
.IR kernelpath .
-Else it will invoke
-.I scram
-to shut down the machine.
+Else it will try to shut down the machine through
+.I /dev/pmctl
+(if available) or invoke
+.IR scram .
The halting and rebooting is done by copying all necessary
commands into a
.IR ramfs (4)