Connection status monitoring tool

view story

http://unix.stackexchange.com – I have an internet connection that is flaky; when it goes bad, there are things that can be done to restore it, so I've made a connection monitoring script to figure out if my connection is gone or not and take action. Some of the actions will actually drop my connection, so I like to be pretty certain that the connection is down before it works its magic. My small script started as a simple pinger and has been evolving and getting more and more complex, so I'm wondering if there is already some project out there that does this? (HowTos)