Posted: Sun Nov 26, 2006 14:11 Post subject: WDS/Connection Watchdog
I'm trying to find out what exactly this feature does.
What I'm trying to do is set up an access point so if for some reason the ethernet goes down or it loses a WDS link then it stops sending it's SSID and waits until it starts working again.
The reason being that I don't want an access point sending a SSID and clients associating if it won't go anywhere, I'd rather it shuts down until it's all ready to go again, then it means clients will try another access point (which may not be so strong, but still has connection to the network rather than having become an "island")
I've found the script in the router, which checks the server to see if it's available or not.
This seems to be just what I want.
However, I would like to make a startup script that tries to ping the server (copy of what's currently in the script), and doesn't start sending SSID beacons or allowing clients to associate until it's got a good ping.
Can anyone tell me what the commands are for turning the beacons on and off and stopping/starting to allow clients to associate?
The theory being that it would turn the radio off, then enter a loop where it keeps trying to ping until it's got a good ping, then turns the radio on. Would it work as I expect?
WDS_WATCHDOG_IPS=$(nvram get wds_watchdog_ips)
wl radio off
for ip in $WDS_WATCHDOG_IPS
do
if ping -c 1 $ip > /tmp/null
then
echo "$ip ok"
else
keeptrying:
echo "$ip dropped one, retrying in 10..."
sleep 10
if ! ping -c 1 $ip > /tmp/null
then
goto keeptrying
fi
fi
done
wl radio on