]> Zhao Yanbai Git Server - minix.git/commitdiff
added poweroff(8)
authorDavid van Moolenbroek <david@minix3.org>
Fri, 12 Jun 2009 13:02:51 +0000 (13:02 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Fri, 12 Jun 2009 13:02:51 +0000 (13:02 +0000)
commands/scripts/Makefile
commands/scripts/poweroff.sh [new file with mode: 0644]
man/man8/poweroff.8 [new file with mode: 0644]

index 4d98a77da778fb087efab738152d71b722bc49ec..f99954fab6d6387c24cada726c17e40b1258f472 100755 (executable)
@@ -45,6 +45,7 @@ usr:  \
        /usr/bin/floppysetup \
        /usr/bin/packit \
        /usr/bin/packman \
+       /usr/bin/poweroff \
        /usr/bin/spell \
        /usr/bin/srccrc \
        /usr/bin/svclog \
@@ -150,6 +151,9 @@ clean:
 /usr/bin/packman:      packman.sh
        install -m 755 -c -o bin $? $@
 
+/usr/bin/poweroff:     poweroff.sh
+       install -m 755 -c -o bin $? $@
+
 /usr/bin/spell:        spell.sh
        install -m 755 -c -o bin $? $@
 
diff --git a/commands/scripts/poweroff.sh b/commands/scripts/poweroff.sh
new file mode 100644 (file)
index 0000000..ccdf699
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# poweroff 1.0 - power off the system          Author: David van Moolenbroek
+#                                                                12 Jun 2009
+
+if [ $# -gt 0 ]; then
+  echo "usage: poweroff" >&2
+  exit 1
+fi
+
+PATH=/usr/bin:$PATH
+
+shutdown -x off
diff --git a/man/man8/poweroff.8 b/man/man8/poweroff.8
new file mode 100644 (file)
index 0000000..31d6bac
--- /dev/null
@@ -0,0 +1,13 @@
+.TH POWEROFF 1
+.SH NAME
+poweroff \- power off the machine
+.SH SYNOPSIS
+.B poweroff
+.SH DESCRIPTION
+This command powers off the machine, by calling
+.B shutdown
+and passing the
+.I off
+directive to the boot monitor.
+.SH "SEE ALSO"
+.BR shutdown (8).