Re: How to run command on resume from "suspend"



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|
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


Relevant Pages