contrib/acpid/default.sh

23 lines
480 B
Bash
Raw Normal View History

2006-11-13 21:01:22 +01:00
#!/bin/sh
2021-02-04 23:50:45 +01:00
#@ Default acpi script that takes an entry for all actions
log() {
2021-02-08 23:56:12 +01:00
logger -t /etc/acpi/default.sh "${*}"
2021-02-04 23:50:45 +01:00
}
2006-11-13 21:01:22 +01:00
2021-02-08 23:56:12 +01:00
set ${*}
2006-11-13 21:01:22 +01:00
2021-02-04 23:50:45 +01:00
# In order to not cumulate ACPI events actual actions should be detached
# from/to /dev/null and backgrounded via &
(
2021-02-08 23:56:12 +01:00
case "${1}" in
2021-02-04 23:50:45 +01:00
button/power)
2021-02-08 23:56:12 +01:00
case "${2}" in
2021-02-04 23:50:45 +01:00
PWRF) /sbin/init 0;;
2021-02-08 23:56:12 +01:00
*) log "button/power action ${2} not handled (${*})";;
2021-02-04 23:50:45 +01:00
esac
;;
2021-02-08 23:56:12 +01:00
*) log "ACPI group ${1} / action ${2} is not defined (${*})";;
2006-11-13 21:01:22 +01:00
esac
2021-02-04 23:50:45 +01:00
) </dev/null >/dev/null 2>&1 &