3 # $NetBSD: sleep_button,v 1.4 2008/05/21 13:06:10 jmcneill Exp $
5 # Generic script for sleep button events.
7 # Arguments passed by powerd(8):
13 /etc
/rc.d
/btdevctl stop
14 /etc
/rc.d
/btconfig stop
16 /etc
/rc.d
/dhclient stop
17 /etc
/rc.d
/network stop
18 /etc
/rc.d
/wpa_supplicant stop
19 if /sbin
/sysctl machdep.sleep_state
>/dev
/null
2>&1; then
20 /sbin
/sysctl
-w machdep.sleep_state
=3
23 if /etc
/rc.d
/apmd status
>/dev
/null
; then
31 /etc
/rc.d
/wpa_supplicant start
32 /etc
/rc.d
/network start
33 /etc
/rc.d
/dhclient start
34 /etc
/rc.d
/ntpdate start
36 /etc
/rc.d
/btconfig start
37 /etc
/rc.d
/btdevctl start
40 # Note that we don't really need to handle a released event here,
41 # so we can gracefully exit.
44 logger
-p warning
"${0}: unsupported event ${2} on device ${1}" >&1