#!/bin/sh #Written by Rick Macdonald with minor tweaks #by Dave Lewis. DEVICE=`sudo grep /dev/ /etc/ppp/options` # check if the device is locked if [ -r /var/lock/LCK..$DEVICE ]; then echo Device $DEVICE is locked exit 1 fi umask 000 # clear out the error log and ppp_is_up flag sudo cp /dev/null /etc/ppp/connect-errors sudo rm -f /etc/ppp/ppp_is_up # run the ppp daemon #sudo /usr/sbin/pppd # <--May work for people that # don't use pppsetup. No guarantees. sudo ppp-on echo echo To abort, press ^C then execute pppkill echo echo -n Dialing PPP... # wait for pppd to start while [ ! -r /var/run/ppp0.pid ]; do if [ `ps -aux | sudo grep -c /usr/sbin/pppd` = 0 ]; then echo Aborted! dos2unix < /etc/ppp/connect-errors echo exit 1 fi sleep 1 done echo Connected! sudo grep CONNECT /etc/ppp/connect-errors echo -n Negotiating PPP... while [ ! -f /etc/ppp/ppp_is_up ]; do if [ `ps -aux | sudo grep -c /usr/sbin/pppd` = 0 ]; then echo Aborted! exit 1 fi sleep 1 done echo OK!