How to run command on resume from "suspend"

Rashkae ubuntu at tigershaunt.com
Fri Jun 8 15:06:44 UTC 2012


On 06/08/2012 10:06 AM, Sam Sebastian wrote:
> For all of the different version of ubuntu/linux I have used on my
> computer whenever it wakes from suspend it is unable to connect to the
> network until I use ifconfig to change the mac address of eth0. Is
> this something that I can fix in ubuntu or is it a problem with my
> router (Linksys E2000)? The command I run is "sudo ifconfig eth0 hw
> ether<thechangedmacaddress>"
>
> Thanks, Sam
>

Create a bash script file in /etc/pm/power.d

For example, call it 100local.  See man pm-powersave for details.

Here's a sample template.

#!/bin/sh
|case $1 in
suspend)
## COMMANDS THAT YOU WISH TO RUN BEFORE SUSPEND
#COMMAND1
echo "Suspeding ..."
;;
resume)
## COMMANDS THAT YOU WISH TO RUN AFTER RESUME
||echo "Resuming ..."|
|;;
hibernate)
## COMMANDS THAT YOU WISH TO RUN BEFORE HIBERNATE
#COMMAND3
echo "Hibernating ..."
;;
thaw)
## COMMANDS THAT YOU WISH TO RUN AFTER RESUME FROM SUSPEND TO DISK
#COMMAND4
;;
esac|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20120608/49d6a26c/attachment.html>


More information about the ubuntu-users mailing list