I am using an HP netbook with a Broadcom wl-card. I use the STA driver. After waking up from sleep it takes normally 30 seconds to be reconnected to my WLAN. Using the command
sudo iwlist scanning
the reconnection process starts immediately. I wrote a script
echo $Password | sudo -S $iwlist scanning
and start it via a starter from the desktop, thus reducing the time to 15 sec.
Is there a way to start the script automatically and preventing the terminal from popping up.
Asked
Active
Viewed 182 times
2
1 Answers
1
First, have a look at how your computer suspends/resumes. According to that you might adapt your script and put it into /etc/pm/sleep.d. The script should look like
#!/bin/sh
case "${i}" in
resume)
$DO_SOMETHING
;;
esac
A second (and better) possibility is to modify /usr/lib/pm-utils/sleep.d. There are some scripts, important are 55NetworkManager and 60_wpa_supplicant. The numbers 55 and 60 are a kind of priority. The lower the number the earlier the suspend script is executed. At resume the scripts are run in reverse order.
So I would suggest copying the scripts from /usr/lib/pm-utils/sleep.d to /etc/pm/sleep.d/ and play around with the first number. Maybe there are some dependencies on your system. You will have to find out through some experimenting.