lid_switch revision 1.4
11.1Smycroft#!/bin/sh -
21.1Smycroft#
31.4Sjnemeth#	$NetBSD: lid_switch,v 1.4 2006/09/27 01:41:45 jnemeth Exp $
41.1Smycroft#
51.4Sjnemeth# Generic script for lid switch events.  We try to put the system to sleep.
61.1Smycroft#
71.1Smycroft# Arguments passed by powerd(8):
81.1Smycroft#
91.1Smycroft#	device event
101.1Smycroft
111.1Smycroftcase "${2}" in
121.3Sjmcneillpressed)
131.3Sjmcneill	if /etc/rc.d/apmd status >/dev/null ; then
141.3Sjmcneill		/usr/sbin/apm -S
151.3Sjmcneill	else
161.3Sjmcneill		/usr/sbin/apm -d -S
171.3Sjmcneill	fi
181.3Sjmcneill	exit 0
191.3Sjmcneill	;;
201.3Sjmcneillreleased)
211.3Sjmcneill	;;
221.1Smycroft*)
231.3Sjmcneill	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
241.1Smycroft	exit 1
251.1Smycroftesac
26