#!/bin/sh # xnet.ppp # # Stand alone dialup and connect PPP example script # links to Naperville on COM2 (cua1). Disconnect with ppp-off. # # This was for the old slackware 2.0 # included with the book "Linux Unleashed". # See ppp-on for current Linux versions. # # by David Efflandt # # I sym linked chat, pppd, fix-cua, unlock # from /usr/lib/ppp to /sbin # # If you install uucp (you likely do not need it) you have to # reference the actual cua device because 'modem' is not 8-bit clean. # LOCKDIR=/var/spool/uucp DEVICE=cua1 # Fill in YOUR username, password and IP address here. PHONE=16303009638 USER=p_UserName PASSWORD=YourPassword OUR_IP_ADDR=199.245.227.xxx if [ -f $LOCKDIR/LCK..$DEVICE ] then echo "PPP device is locked" exit 1 fi fix-cua $DEVICE # Note: omit "-l LCK..$DEVICE" with ppp-2.2.0e or newer # and use "lock" in /etc/ppp/options instead if needed # (-l is no longer a chat option) ( stty 38400 -crtscts -tostop if chat -v -l LCK..$DEVICE ABORT "NO CARRIER" ABORT BUSY "" ATZ OK ATDT$PHONE CONNECT "" ogin: $USER ssword: \\q$PASSWORD then pppd modem defaultroute $OUR_IP_ADDR: /dev/$DEVICE sleep 10 exit 0 else echo "PPP call failed" 1>&2 exit 1 fi ) < /dev/$DEVICE > /dev/$DEVICE