#!/bin/sh
# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}
action=${1/*\//}

case "$group" in
	button)
		case "$action" in
			power)	shutdown -h now "Power button pressed"
				;;
		        lid)    /etc/acpi/actions/lid.sh
			        ;;
		        sleep)  /usr/local/sbin/hibernate
			        ;;
			*)	logger "ACPI action $action is not defined"
				;;
		esac
		;;

        ac_adapter)
	        /etc/acpi/actions/ac.sh
		;;
        battery)
	        /etc/acpi/actions/battery.sh %e
		;;
	*)
		logger "ACPI group $group / action $action is not defined"
		;;
esac
