Notes From James
Home | About | Download
Ubuntu: Automatically reconnecting a wireless connection   Wednesday, December 24, 2008, 3:12 am

I have an old cordless phone. A phone that, once it rings, causes my local wireless network to go down. Windows seems to repair itself, but Ubuntu just hangs there dead until I manually reconnect it. Here is a solution that checks the network every minute. If there is a failure (30 seconds or so after checking), the network is restarted.

First, make a file called check_network in the /root directory by using 'sudo vi /root/check_network'. In it, put the following code:

wget -q -O /dev/null "http://www.google.com" || ( /etc/init.d/networking restart )

This checks the connection (in this case, against Google). If it doesn't, it causes the network to restart. Now, add this to the root user's crontab file by running 'sudo crontab -e'. The crontab file should look like:

# m h  dom mon dow   command
* * * * * /root/check_network

This means, every minute, run the check_network script. I wish there was a better way of doing this. Actually, if there could be a tie-in to the icon that shows the connectivity in the toolbar, that would be an even better solution.

Tags: Linux, Technology, Web
No Comments
Comment
Your Name:
Web site (i.e. www.xxx.com):
Antispam: Type 'pizza' backwards:
Comment:


[Asbury Elementary School Information]  [Them! Re-imagining]  
Important Stuff
Ghofulpo.com
Bike to Work Week

Friends
Peter PoP
Sneakatron

Latest Posts

Find Stuff
By Date, tags, etc.

Commands
Home
RSS
Index
Login