You could try this:What script commands are available to stop and restart the WAN connection?
service "restart_wan_if 0"
#!/bin/bash
sleep 60
count=0
while true ; do
sleep 15
if ping -c1 -w1 8.8.8.8 >/dev/null 2>&1 ; then
count=0
else
count=$((count + 1))
if [ $count -gt 4 ]; then
count=0
ifconfig eth0 down
sleep 1
service "restart_wan_if 0"
fi
fi
done
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!