#!/bin/sh

# connect script for ilsundal's ppp-in-a-box.

checkforroot() {
        if [ "$EUID" -ne 0 ]; then
                echo "You must be root to initiate a PPP connection."
                exit 1
        fi
}
checkforroot
echo 
echo PPP-Link initiated.

# disables any ethernet devices connected to machine, uncomment if you are
# experiencing any form of conflict between your modem, and ethernet
# devices. (will infact disable this machine from the rest of your network
# [if any.]) 

#ifconfig eth0 down

# deletes current defaultroute, and sets ppp0 to defaultroute.  comment if
# you would like to keep your existing defaultroute setup.

route del default
route add default ppp0

# echo's all connection garbage to /dev/null where it belongs.
/etc/ppp/ppp > /dev/null &
