So I want to keep an eye on my network connectivity so I can make a report for my ISP. (seems like the modem goes out for about 30-60 seconds about once a day)
So I copied this handy little script
And an running it with
watch -n 15 ./ping-test.sh
I have been testing it by pulling the plug on my modem.
The first time watch runs the script after the network goes out it runs fine (sends some email) and then goes defunct. Once networking is restored the script "finishes" and then watch runs it again.
So I'm getting mail for when the network goes down, but not how long it was down for.
If I run the script straight from the command line it runs (emails) and then exits.
Any ideas why? How can I get the script to keep running once the network is down?