Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/etc/powerd/scripts - use -q to test for presence of a sysctl...
details: https://anonhg.NetBSD.org/src/rev/5258260527da
branches: trunk
changeset: 769666:5258260527da
user: jym <jym%NetBSD.org@localhost>
date: Sat Sep 17 14:44:18 2011 +0000
description:
- use -q to test for presence of a sysctl(7) variable silently
- modify powerd(8) sleep_button script so it can handle the soon-to-be
Xen suspend command.
diffstat:
etc/powerd/scripts/sleep_button | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (23 lines):
diff -r 7972516a0243 -r 5258260527da etc/powerd/scripts/sleep_button
--- a/etc/powerd/scripts/sleep_button Sat Sep 17 14:25:43 2011 +0000
+++ b/etc/powerd/scripts/sleep_button Sat Sep 17 14:44:18 2011 +0000
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $NetBSD: sleep_button,v 1.8 2011/05/27 09:28:42 plunky Exp $
+# $NetBSD: sleep_button,v 1.9 2011/09/17 14:44:18 jym Exp $
#
# Generic script for sleep button events.
#
@@ -17,8 +17,10 @@
/etc/rc.d/network stop
/etc/rc.d/wpa_supplicant stop
- if /sbin/sysctl hw.acpi.sleep.state >/dev/null 2>&1; then
+ if /sbin/sysctl -q hw.acpi.sleep.state; then
/sbin/sysctl -w hw.acpi.sleep.state=3
+ elif /sbin/sysctl -q machdep.xen.suspend; then
+ /sbin/sysctl -w machdep.xen.suspend=1
else
sleep 1
if /etc/rc.d/apmd onestatus >/dev/null ; then
Home |
Main Index |
Thread Index |
Old Index