Here's what the Canonical support engineer suggested.
20/11/2011 22:53 | Jason
My suggestion is to create a script under the /etc/pm/sleep.d/. The script will be execute when resume from suspend. Please reference to the /usr/share/doc/pm-utils/HOWTO.hooks.gz for the details.
Here's the intro from that file:
How to write a pm-utils hook:
PARAMETERS
A pm-utils hook is simply an executable file that accepts at least one
parameter.
For hooks in sleep.d, the potential values of the first parameter are:
suspend -- The hook MUST perform whatever action is appropriate when the
system is preparing for memory sleep (or its equivalent).
resume -- The hook MUST perform whatever action is appropriate when the
system is coming out of suspend.
hibernate -- The hook MUST perform whatever action is appropriate when
the system is preparing for suspend-to-disk.
thaw -- The hook MUST perform whatever action is appropriate when the system
is coming out of suspend-to-disk.
help -- If your hook parses the PM_CMDLINE environment variable for switches,
this function SHOULD output text describing the parameters it parses
in a format easily understandable by an end-user.
The actual sleep method being used will be passed as the second parameter --
if your hook needs to handle suspend-hybrid (or any other platform-specific
sleep method), it should examine the second parameter.
For hooks in power.d, the potential values of that parameter are:
true -- the hook MUST perform whatever action is appropriate when the system
transitions TO battery power.
false -- The hook MUST perform whatever action is appropriate when the system
transitions FROM battery power.
And here's an example:
#!/bin/bash
case "$1" in
hibernate|suspend)
ACTION BEFORE SUSPEND/HIBERNATE
;;
thaw|resume)
ACTION AFTER RESUME
;;
*)
;;
esac
exit $?