lid_switch revision 1.5
11.1Smycroft#!/bin/sh - 21.1Smycroft# 31.5Sjmcneill# $NetBSD: lid_switch,v 1.5 2008/06/20 02:38:00 jmcneill 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.5Sjmcneill #if /etc/rc.d/apmd status >/dev/null ; then 141.5Sjmcneill # /usr/sbin/apm -S 151.5Sjmcneill #else 161.5Sjmcneill # /usr/sbin/apm -d -S 171.5Sjmcneill #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