| LinHES Forums http://forums.linhes.org/ |
|
| Wireless connection fails to reconnect http://forums.linhes.org/viewtopic.php?f=2&t=17296 |
Page 1 of 1 |
| Author: | kc7bfi [ Tue Nov 20, 2007 8:39 pm ] |
| Post subject: | Wireless connection fails to reconnect |
I am using a USB wireless network device. When my myth box starts up, the wireless network comes up normally. However, overtime, the box looses its network connection and does not automatically reconnect to the preferred network. I have to reboot the box to get it to connect again (or bring up a shell and restart the network). Is there anyway to have knoppmyth automatically reconnect the wireless network? Thanks, David Robison |
|
| Author: | cecil [ Tue Nov 20, 2007 11:43 pm ] |
| Post subject: | |
You could write a script that restarts network. Then create a cron job that runs at X interval. |
|
| Author: | mac [ Wed Nov 21, 2007 8:37 am ] |
| Post subject: | |
Here is one that I wrote to check my connection, this is called from crontab every ten minutes.. What is does is try to ping the default gateway address, if it gets a response it exits -- if not restarts the connection and logs the event to syslog. Code: #!/usr/bin/perl open(DE,"route -n|"); while(<DE>){ /^0\.0\.0\.0\s+(\d+\.\d+\.\d+\.\d+)/; $def=$1 if $1; } open(PING,"ping -c2 $def 2>/dev/null |"); while(<PING>){ /\d+\sbytes\sfrom.*(ms)/; $res=$1 if $1; } exit if $res; system("/usr/bin/con > /dev/null 2>&1"); system("/usr/bin/logger Wireless Connection Restart"); /usr/bin/con is the script that restarts the connection: /usr/bin/con Code: #!/bin/bash
killall -v dhclient iwlist wlan0_rename scan dhclient wlan0_rename |
|
| Page 1 of 1 | All times are UTC - 6 hours |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|