summaryrefslogtreecommitdiff
path: root/sysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd
diff options
context:
space:
mode:
authorjmcneill <jmcneill@pkgsrc.org>2008-11-27 03:32:19 +0000
committerjmcneill <jmcneill@pkgsrc.org>2008-11-27 03:32:19 +0000
commiteae81391a0129894a2defb744efde941faca12c4 (patch)
treebd04573b2d628005472823fb4eeea46225f4a592 /sysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd
parent991a8abd742c652b8d70f8af9d24470ddd5881f0 (diff)
downloadpkgsrc-eae81391a0129894a2defb744efde941faca12c4.tar.gz
Add reboot, shutdown, suspend support. Bump PKGREVISION.
Diffstat (limited to 'sysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd')
-rwxr-xr-xsysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd19
1 files changed, 19 insertions, 0 deletions
diff --git a/sysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd b/sysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd
new file mode 100755
index 00000000000..d05d8bca9b2
--- /dev/null
+++ b/sysutils/hal/files/tools-netbsd/hal-system-power-shutdown-netbsd
@@ -0,0 +1,19 @@
+#!/bin/sh
+# $NetBSD: hal-system-power-shutdown-netbsd,v 1.1 2008/11/27 03:32:19 jmcneill Exp $
+
+unsupported() {
+ echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
+ echo "No shutdown command found" >&2
+ exit 1
+}
+
+#Try for common tools
+if [ -x "/sbin/shutdown" ] ; then
+ /sbin/shutdown -p now
+ exit $?
+elif [ -x "/usr/sbin/shutdown" ] ; then
+ /usr/sbin/shutdown -p now
+ exit $?
+else
+ unsupported
+fi