#!/bin/bash # (/root/tcp-watchdog.bash &) /dev/null counter=0 while true; do if curl -sSf -m 5 http://www.google.com/generate_204; then counter=0 else ((counter++)) if [ "$counter" -gt 60 ]; then logger 'tcp-watchdog: failed for 10 minutes, restart...' #service networking restart #reboot orb restart $(hostname) fi fi sleep 10 done