Use hw.acpi.sleep.state instead of machdep.sleep_state.
This commit is contained in:
parent
e26a5e9d52
commit
7373892abb
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: sleep_button,v 1.6 2010/09/19 21:47:28 abs Exp $
|
||||
# $NetBSD: sleep_button,v 1.7 2010/12/31 09:36:15 jruoho Exp $
|
||||
#
|
||||
# Generic script for sleep button events.
|
||||
#
|
||||
@ -10,14 +10,16 @@
|
||||
|
||||
case "${2}" in
|
||||
pressed)
|
||||
|
||||
/etc/rc.d/btdevctl stop
|
||||
/etc/rc.d/btconfig stop
|
||||
/etc/rc.d/ntpd stop
|
||||
/etc/rc.d/dhclient stop
|
||||
/etc/rc.d/network stop
|
||||
/etc/rc.d/wpa_supplicant stop
|
||||
if /sbin/sysctl machdep.sleep_state >/dev/null 2>&1; then
|
||||
/sbin/sysctl -w machdep.sleep_state=3
|
||||
|
||||
if /sbin/sysctl hw.acpi.sleep.state >/dev/null 2>&1; then
|
||||
/sbin/sysctl -w hw.acpi.sleep.state=3
|
||||
else
|
||||
sleep 1
|
||||
if /etc/rc.d/apmd onestatus >/dev/null ; then
|
||||
@ -28,6 +30,7 @@ pressed)
|
||||
# ... waking up
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
/etc/rc.d/wpa_supplicant start
|
||||
/etc/rc.d/network start
|
||||
/etc/rc.d/dhclient start
|
||||
@ -36,6 +39,7 @@ pressed)
|
||||
/etc/rc.d/btconfig start
|
||||
/etc/rc.d/btdevctl start
|
||||
;;
|
||||
|
||||
released)
|
||||
# Note that we don't really need to handle a released event here,
|
||||
# so we can gracefully exit.
|
||||
|
Loading…
Reference in New Issue
Block a user