Have a look at the file /etc/acpi/acpi_handler.sh
That's its location on Slackware - on RH it may have a different location.
You will need something like the following in it:
# Default acpi script that takes an entry for all actions
case "$1" in
case "$2" in
power) /sbin/init 0
*) logger "ACPI action $2 is not defined"
logger "ACPI group $1 / action $2 is not defined"
The line in red is the crucial line. You might like to change it to one of the shutdown commands or poweroff.
If you want it to do something more complex, then have it call your own script in that line and put the commands you want it to execute in that script.
Place your script in the same directory as that of acpi_handler.sh.