contrib/acpid/default.sh

23 lines
462 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() {
logger -t /etc/acpi/default.sh "$*"
}
2006-11-13 21:01:22 +01:00
set $*
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 &
(
2006-11-13 21:01:22 +01:00
case "$1" in
2021-02-04 23:50:45 +01:00
button/power)
case "$2" in
PWRF) /sbin/init 0;;
*) log "button/power action $2 not handled ($*)";;
esac
;;
*) 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 &