2003-04-18 09:40:06 +04:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
2003-11-02 02:04:54 +03:00
|
|
|
# $NetBSD: power_button,v 1.3 2003/11/01 23:04:54 mycroft Exp $
|
2003-04-18 09:40:06 +04:00
|
|
|
#
|
|
|
|
# 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)
|
2003-11-02 02:04:54 +03:00
|
|
|
/sbin/shutdown -p now "power button pressed"
|
2003-04-18 09:40:06 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2003-10-30 20:32:45 +03:00
|
|
|
logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
|
2003-04-18 09:40:06 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|