I need to run a script on a Suspend/Hibernate and on a Resume/Thaw. Now, I know the place to put the script is /etc/pm/sleep.d/ but this doesn't seem to work for a script requiring access to the network as the network is either already down or not up yet when it runs. Is there another place I need to put my script so it has access to the network before the network is shutdown on a suspend and after the network is up on a resume?
Basically, I just need to send out a UDP broadcast like:
echo -n "Resumed" | socat - udp-datagram:192.168.5.255:5100,broadcast
I'm running ubuntu 11.10.