Need an Introduction to Tiny Core? Or peruse Core Concepts.
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