# anyway to run a script after resume from suspend?[Solved]

## hezhit

I would like to reconnect my network device using a shell script.

can acpi event use for this purpose or any other easy way?Last edited by hezhit on Thu Apr 30, 2009 7:54 am; edited 1 time in total

----------

## ppurka

Try reading this:

http://www.gentoo-wiki.info/Hibernate-script

And if you are using tuxonice (tuxonice-sources), then this too:

http://en.gentoo-wiki.com/wiki/TuxOnIce#Userland_Script_Installation_and_Configuration

Finally, if you are using default suspend (gentoo-sources/vanilla-sources), then read this instead:

http://en.gentoo-wiki.com/wiki/Userspace_software_suspend#Hibernate_script

----------

## Kulfaangaren!

Take a look at pm-utils wiki at OpenSUSE.

Pm-utils seems to be able to do what I think you need to do.

// Fredrik

----------

## michel7

i just post an example of script running after suspend to ram and working on my machine ... pm-utils should be installed

/etc/pm/sleep.d/95led

```

#!/bin/sh

# Enable WLAN LED after suspending to ram on Asus Laptop.

case "$1" in

        thaw|resume)

                echo "1" > /sys/devices/platform/asus-laptop/wlan

                ;;

        *)

                ;;

esac

```

P.S: you may find a lot of examples in /usr/lib/pm-utils/sleep.d/

----------

## hezhit

thx all above, they help me a lot.

----------

