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
We use essential cookies to make this site work, and optional cookies to enhance your experience.