You should have acpi_handler.sh call a script located in the same directory.
You can then run '/etc/rc.d/rc.inet1 ath0_start' from there.
I start hibernate by pressing the power button. Here's what I have on my machine:
acpi_handler.sh:
Code:
#!/bin/sh
# Default acpi script that takes an entry for all actions
IFS=${IFS}/
set $@
case "$1" in
button)
case "$2" in
# power) /sbin/init 0
power) /etc/acpi/hibernate.sh
;;
*) logger "ACPI action $2 is not defined
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac
hibernate.sh:
Code:
#!/bin/sh
# Switch to console terminal to avoid graphics corruption in X:
chvt 1
# Flush all data to disk (just in case...):
sync
# turn off dhcpcd
/sbin/dhcpcd -k
# Save the system time
hwclock --systohc --localtime
# Suspend:
echo -n "mem" > /sys/power/state
# Now we are sleeping.
# Restore the system time:
hwclock --hctosys --localtime
# restart dhcpcd
/sbin/dhcpcd -d -t 30 -R eth0
# get time
/usr/sbin/ntpdate be.pool.ntp.org nl.pool.ntp.org fr.pool.ntp.org
# Switch back to X:
chvt 7