Home | History | Annotate | Line # | Download | only in scripts
lid_switch revision 1.4.18.1
      1       1.1   mycroft #!/bin/sh -
      2       1.1   mycroft #
      3  1.4.18.1       mjf #	$NetBSD: lid_switch,v 1.4.18.1 2008/06/29 08:38:43 mjf Exp $
      4       1.1   mycroft #
      5       1.4   jnemeth # Generic script for lid switch events.  We try to put the system to sleep.
      6       1.1   mycroft #
      7       1.1   mycroft # Arguments passed by powerd(8):
      8       1.1   mycroft #
      9       1.1   mycroft #	device event
     10       1.1   mycroft 
     11       1.1   mycroft case "${2}" in
     12       1.3  jmcneill pressed)
     13  1.4.18.1       mjf 	#if /etc/rc.d/apmd status >/dev/null ; then
     14  1.4.18.1       mjf 	#	/usr/sbin/apm -S
     15  1.4.18.1       mjf 	#else
     16  1.4.18.1       mjf 	#	/usr/sbin/apm -d -S
     17  1.4.18.1       mjf 	#fi
     18       1.3  jmcneill 	exit 0
     19       1.3  jmcneill 	;;
     20       1.3  jmcneill released)
     21       1.3  jmcneill 	;;
     22       1.1   mycroft *)
     23       1.3  jmcneill 	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
     24       1.1   mycroft 	exit 1
     25       1.1   mycroft esac
     26