#!/bin/sh # ppp-on # Set up a PPP link # # /etc/ppp/pap-secrets file must exist and contain # USERNAME * PASSWORD # LOCKDIR=/var/lock DEVICE=modem umask 022 PHONE=485-8228 NAME=my_username_here if [ -f $LOCKDIR/LCK..$DEVICE ] then echo "PPP device is locked" exit 1 fi ( setserial /dev/$DEVICE spd_vhi stty 38400 -tostop crtscts if /usr/sbin/chat -v ABORT "NO CARRIER" ABORT BUSY "" ATZ OK ATD$PHONE CONNECT "" then echo "chat successful, attempting pppd at `date`..." > /dev/console /usr/sbin/pppd /dev/$DEVICE crtscts name $NAME defaultroute & sleep 5 exit 0 else echo "PPP call failed" 1>&2 exit 1 fi ) < /dev/$DEVICE > /dev/$DEVICE