Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/powerd Add a default power_button script for powerd(8).



details:   https://anonhg.NetBSD.org/src/rev/f132753080c2
branches:  trunk
changeset: 545953:f132753080c2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Apr 18 05:40:06 2003 +0000

description:
Add a default power_button script for powerd(8).

diffstat:

 etc/powerd/Makefile             |   5 +++++
 etc/powerd/scripts/Makefile     |  14 ++++++++++++++
 etc/powerd/scripts/power_button |  23 +++++++++++++++++++++++
 3 files changed, 42 insertions(+), 0 deletions(-)

diffs (54 lines):

diff -r 086cb6c822ee -r f132753080c2 etc/powerd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/powerd/Makefile       Fri Apr 18 05:40:06 2003 +0000
@@ -0,0 +1,5 @@
+#      $NetBSD: Makefile,v 1.1 2003/04/18 05:40:06 thorpej Exp $
+
+SUBDIR+= scripts
+
+.include <bsd.subdir.mk>
diff -r 086cb6c822ee -r f132753080c2 etc/powerd/scripts/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/powerd/scripts/Makefile       Fri Apr 18 05:40:06 2003 +0000
@@ -0,0 +1,14 @@
+#      $NetBSD: Makefile,v 1.1 2003/04/18 05:40:06 thorpej Exp $
+
+.include <bsd.own.mk>
+
+# if you're adding new scripts, don't forget to update followings.
+#      src/etc/mtree/special
+#      src/distrib/sets/lists/etc/mi
+
+FILES= power_button
+
+FILESDIR=      /etc/powerd/scripts
+FILESMODE=     ${BINMODE}
+
+.include <bsd.prog.mk>
diff -r 086cb6c822ee -r f132753080c2 etc/powerd/scripts/power_button
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/powerd/scripts/power_button   Fri Apr 18 05:40:06 2003 +0000
@@ -0,0 +1,23 @@
+#!/bin/sh -
+#
+#      $NetBSD: power_button,v 1.1 2003/04/18 05:40:06 thorpej Exp $
+#
+# Generic script for power button events.  We simply attempt to
+# shut the system down gracefully, and let the kernel handle
+# the poweroff.
+#
+# Arguments passed by powerd(8):
+#
+#      device event
+
+case "${2}" in
+pressed)
+       /sbin/shutdown -p now
+       exit 0
+       ;;
+
+*)
+       echo "${0}: unsupported event ${2} on device ${1}" >&1
+       exit 1
+       ;;
+esac



Home | Main Index | Thread Index | Old Index