2006-11-13 22:01:22 +02: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 22:01:22 +02:00
|
|
|
|
2021-03-18 18:24:59 +01:00
|
|
|
unhandled() {
|
|
|
|
t=${1}
|
|
|
|
shift
|
2021-05-01 17:41:14 +02:00
|
|
|
log "ACPI: no handler for event ${t}, data: ${*}"
|
2021-03-18 18:24:59 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-02-08 23:56:12 +01:00
|
|
|
set ${*}
|
2006-11-13 22:01:22 +02:00
|
|
|
|
2021-03-18 18:24:59 +01:00
|
|
|
# In order to not cumulate actions of ACPI event they should be detached via
|
|
|
|
# ( ACTION ) </dev/null >/dev/null 2>&1 &
|
|
|
|
# (At least setting volume or other things which depend on hardware which might
|
|
|
|
# block and cause the script not to return for a while.)
|
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-03-18 18:24:59 +01:00
|
|
|
PWRF)
|
|
|
|
/sbin/init 0;;
|
|
|
|
*)
|
2021-05-01 17:41:14 +02:00
|
|
|
unhandled "${#}: ${@}";;
|
2021-02-04 23:50:45 +01:00
|
|
|
esac
|
|
|
|
;;
|
2021-03-18 18:24:59 +01:00
|
|
|
*)
|
2021-05-01 17:41:14 +02:00
|
|
|
unhandled "${#}: $@";;
|
2006-11-13 22:01:22 +02:00
|
|
|
esac
|