|
bash-2.05b# cat /etc/acpi/events/default # This is the ACPID default configuration, it takes all # events and passes them to /etc/acpi/default.sh for further # processing. # event keeps a regular expression matching the event. To get # power events only, just use something like "event=button power.*" # to catch it. # action keeps the command to be executed after an event occurs # In case of the power event above, your entry may look this way: #event=button power.* #action=/sbin/init 0 # Optionally you can specify the placeholder %e. It will pass # through the whole kernel event message to the program you've # specified. event=.* action=/etc/acpi/acpi_handler.sh %e bash-2.05b# |
|
bash-2.05b# cat /etc/acpi/acpi_handler.sh # a sample skeleton for handling ACPI events if [ $# != 1 ]; then exit 1 fi set $* case "$1" in button) case "$2" in power) /sbin/init 0 ;; *) logger "ACPI action $2 is not defined" ;; esac ;; *) logger "ACPI group $1 is not defined" ;; esac bash-2.05b# |
|
bash-2.05b# cat /etc/acpi/acpi_handler.sh # a sample skeleton for handling ACPI events if [ $# != 1 ]; then exit 1 fi set $* case "$1" in button/power) case "$2" in PWRF) /sbin/init 0 ;; *) logger "ACPI action $2 is not defined" ;; esac ;; *) logger "ACPI group $1 is not defined" ;; esac bash-2.05b# |