Execute a command after resume from suspend

https://askubuntu.com/questions/92218/how-to-execute-a-command-after-resume-from-suspend

place your scripts in the /etc/pm/sleep.d directory to have them run after suspend.
you need to add a conditional to make your script run only during resume and not during the suspend process .
Be sure your script is marked globally executable and change $USER to the corresponding username.

For example :

case "${1}" in
    resume|thaw)
        # code here
;;
esac

more detailed information in the pm-suspend manpage (man pm-suspend)
or by looking at the documentation in /usr/share/doc/pm-utils (particularly /usr/share/doc/pm-utils/HOWTO.hooks.gz).