NetBSD/etc/powerd/scripts/lid_switch
jmcneill d54c2134a8 Add useful example scripts for powerd acadapter, lid_switch, and
sleep_button events. These use the /dev/apm interface, so should be useful
on more than just i386.
2006-09-26 02:17:38 +00:00

26 lines
426 B
Bash
Executable File

#!/bin/sh -
#
# $NetBSD: lid_switch,v 1.3 2006/09/26 02:17:38 jmcneill Exp $
#
# Generic script for lid switch events. We do nothing for now.
#
# Arguments passed by powerd(8):
#
# device event
case "${2}" in
pressed)
if /etc/rc.d/apmd status >/dev/null ; then
/usr/sbin/apm -S
else
/usr/sbin/apm -d -S
fi
exit 0
;;
released)
;;
*)
logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
exit 1
esac