I wrote a better script:
#!/bin/bash
iwevent | grep Associated --line-buffered | while read line
do
sleept 2
date >> /etc/scripts/log/wlan_restart2
/etc/init.d/net.ath0 restart 2>&1 >> /etc/scripts/log/wlan_restart2
echo >> /etc/scripts/log/wlan_restart2
done
On Ubuntu it uses if(up|down). Where do I have to put the following
under Gentoo? There does not seem to be a post-up directive in
/etc/conf.d/net.
start-stop-daemon -mbSx /etc/scripts/wlan_restart2 -p
/etc/scripts/log/wlan.pid
Robert J. C. Himmelmann wrote:
Thanks, that seems to be helping. Restarting the connection is also much
faster now. Does anyone now how to instruct the driver to reconnect once
it looses the connection? At the moment I am using a small script for
that which is run by cron every few minutes:
#!/bin/bash
ping -c 2 -w 10 -q 192.168.0.1 || /etc/init.d/net.ath0 restart
In /etc/contab:
*/3 * * * * root /etc/scripts/wlan_restart
Obviously this has quite a big overhead and is slow as it has to wait
for ping to timeout.