I thought I'd share this with everyone. I'm not sure if there's already something like this on the Net... probably is but I was too lazy to look around so I wrote my own.

Anyways, the following script will check to see if your ADSL connection is up and running. If it's not, it restarts it for you. It performs two checks. First to see if the PID of your ADSL client is running, and if it is, it checks to see if you can actually ping servers on the Net. If it fails either the first or second check, the connection is restarted. I recommend having it started from root's crontab:

* * * * * /usr/local/sbin/adsl-restart 2> /dev/null 1> /dev/null

Now for the script:

Code:
#!/bin/bash
# adsl-restart - Restarts an ADSL connection if it's not active.
# This program is tailored for the Roaring Penguin PPPoE client.
# X_console <shellscope@yahoo.com>

# firewall script:
FIREWALL="/etc/firewall/gShield.rc"

# servers to ping in order to determine if we have an active
# connection. you must NOT put in a machine that is in your LAN!
# make sure the server is somewhere on the Internet and that it does
# not block pings:
S1="linux.com"
S2="slackware.com"
S3="freebsd.org"
S4="yahoo.com"
S5="yorku.ca"

# this variable reflects on the total number of servers
# you want to ping:
totalServer=5

# this is a counter to determine how many servers responded
# to the ping sent:

response=0

# restart() restarts the ADSL connection:
restart()
{
        # connection is down. we need to restart it along
        # with the firewall script:
        /usr/sbin/adsl-stop; wait
        echo "Activating ADSL connection..."
        /usr/sbin/adsl-start; wait
        $FIREWALL
}

# CHECK 1: see if the ADSL process is running:
if [ ! -f /var/run/adsl.pid ]; then
        # connection is not running, so we restart it:
        restart
else
        # it looks like the PID is still there, but sometimes
        # we still can't access the Net... so we move on to
        # CHECK 2...
        # CHECK 2: start pinging each of the servers:
        for server in $S1 $S2 $S3 $S4 $S5; do

                # we send one ping request to each server. if all or any of
                # the servers respond, then the connection is up. if none of
                # them respond, then we restart the connection:
                printf "Now pinging $server...\n"
                ping -c1 $server 1>&2 > /dev/null

                if [ "$?" -eq 0 ]; then # server responded!
                        printf "Response from $server\n"
                        response=$((response + 1));
                else
                        printf "No response from $server\n"
                        response=$((response + 0));
                fi
        done

        # if the response is greater than 0, then the ADSL connection
        # is up. if it's 0, then we have to restart the ADSL connection:

        if [ "$response" -gt 0 ]; then
                # ADSL connection is up so we exit:
                exit 0
        else
                # ADSL connection is down, so we restart it:
                restart
        fi
fi
By the way, the above was made for the Roaring Penguin PPPoE client... it can probably be modified to suit your PPPoE client though.