Raspberry Pi port, piCore-15.0 is available!
cat /usr/local/etc/acpi/events/powerevent=button[ /]poweractions=/usr/local/etc/acpi/actions/power.sh "%e"
cat /usr/local/etc/acpi/actions/power#! /bin/shexitcheck.sh shutdown
cat ~/.X.d/initsudo /usr/local/etc/init.d/acpid start
actions=
action=
cat /usr/local/etc/acpi/events/powerevent=button[ /]poweraction=exitcheck.sh