3 # $NetBSD: sensor_battery,v 1.5 2007/10/11 19:47:26 xtraeme Exp $
5 # Generic script for battery sensors.
7 # Arguments passed by powerd(8):
9 # script_path device event sensor state_description
14 "${0}: (${3}) capacity reached normal state [${1}]" >&1
18 logger
-p warning
"${0}: (${3}) state changed to ${4} [${1}]" >&1
23 "${0}: (${3}) capacity below warning limit [${1}]" >&1
28 "${0}: (${3}) capacity below critical limit [${1}]" >&1
32 # This event is _ONLY_ received when all AC Adapters are OFF and all
33 # batteries on the system are in CRITICAL or LOW state.
35 # It is not recommended to remove the shutdown call.
38 logger
-p warning
"${0}: LOW POWER! SHUTTING DOWN." >&1
39 /sbin
/shutdown
-p now
"${0}: LOW POWER! SHUTTING DOWN."
43 logger
-p warning
"${0}: unsupported event ${2} on device ${1}" >&1