#!/bin/sh
# Put this script to be invoked in cron on 1 minute
# cron like this should suffice
# */1 * * * * /path/to/check-dsl.sh
# host to ping best is to be the provider dns
host_to_ping="212.50.0.53";

if [[ $(ping -c 4 $host_to_ping |grep -i '100%') ]]; then
/etc/init.d/networking restart 2>&1 >/dev/null;
exit 0;
else
exit 0;
fi
