Hello all, I am looking to write some sort of script to run on my tomato router that will (a) log whenever my WAN link goes down and (b) how long it goes out for. I started to try to script this by running ICMP checks to a public DNS server, and then whenever it failed for 4 consecutive ping tests it would log a message stated that the link went out. However, if my connection goes out for 5 minutes, I simply want the message to say 'WAN link outage occured. Duration: 5 minutes' or something like that, instead of seeing the same message many times. I just don't know exactly how to script that up, and wanted to see if others could help. Here is the script I currently have: Code: while [ true ]; do if ping -c 4 -W 1 188.8.131.52 | grep "100% packet loss" ; then logger Ping to 184.108.40.206 FAILED -p9 else sleep 10 fi done Thanks!