For various reasons, you might want to monitor your Internet connectivity. The simplest way to do this is to run a custom task script. The basic command structure might look something like this:
For example, in the Scheduler menu, in the Custom 1 field:
/bin/ping -q -c1 22.214.171.124
The 126.96.36.199. IP address is a google DNS server. This scheduled command would allow monitoring without requiring any further interaction with the user.
Next, in order to link an action to a success (&&) or failure (||) , we will append a command to the wanted condition.
#if ping fails, restart the wan. /bin/ping -q -c1 188.8.131.52 || /sbin/service wan restart # if ping fails, reboot the device. /bin/ping -q -c1 184.108.40.206 || /sbin/reboot # successful pings will log "Internet Available" where ping failures will log "Internet unavailable". /bin/ping -q -c1 220.127.116.11 && /usr/bin/logger "Internet available" || /usr/bin/logger "Internet unavailable"
This script is a custom one. Please note that there is also a setting in FreshTomato's Network Web interface menu called “Check Connections Every”. This feature performs similar functions, with some differences. It is not recommended that you use both this watchdog script and the Check Connections Every function at the same time. The two functions may interfere with each other, and conflicts might occur.