On Wed, Feb 26, 2014 at 8:35 PM, Lee <ny6...@gmail.com> wrote: > Hi, I always need to reconnect my laptop pcmcia wireless card to my WAP when > awaking from suspend.
Something similar happens with my bluetooth dongle; I need to stop the service, unload the kernel module, load it again, and start the service once more. > It would be nice if I could add two commands, ifconfig > and dhpcd, to the script which controls awaking from suspend. Anyone know > which file I can edit? Others have already gave you answers. I do not believe you use systemd; but for whomever else that does, I leave this here: systemd has a set of directories (one for sleep, another for hibernate, and a third one for "hybrid" modes), where you can drop any executable you want to be executed in any of those situations. From [1]: """ Immediately before entering system suspend and/or hibernation systemd-suspend.service (and the other mentioned units, respectively) will run all executables in /usr/lib/systemd/system-sleep/ and pass two arguments to them. The first argument will be "pre", the second either "suspend", "hibernate", or "hybrid-sleep" depending on the chosen action. Immediately after leaving system suspend and/or hibernation the same executables are run, but the first argument is now "post". All executables in this directory are executed in parallel, and execution of the action is not continued until all executables have finished. """ My bluetooth problem gets fixed with a little executable script in /usr/lib/systemd/system-sleep: #!/bin/bash case "$1" in "post") sleep 3 systemctl stop bluetooth.service rmmod rfcomm rmmod bnep rmmod btusb rmmod bluetooth modprobe bluetooth modprobe btusb modprobe bnep modprobe rfcomm systemctl start bluetooth.service ;; esac exit 0 Regards. [1] http://www.freedesktop.org/software/systemd/man/systemd-sleep.html -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México