#!/bin/sh

#
#	ppp-on
#
#	Set up a PPP link
#
cd /usr/lib/ppp

# for slirp
#LIP=10.0.2.15

#LIP=129.118.9.222
#RIP=129.118.9.254
LOCKDIR=/var/lock
DEVICE=modem

if [ -f $LOCKDIR/LCK..$DEVICE ]
then
    echo "PPP device is locked"
    exit 1
fi

/usr/lib/ppp/fix-tty $DEVICE

(
    stty  38400 -tostop

#    pppd connect 'chat -v -f /usr/lib/ppp/lub-gw.scr ' 198.170.218.3: \
#	 /dev/$DEVICE crtscts 38400 modem defaultroute -detach lock
# The above was commented out and edited (below) because of a problem
# with the 'modem' option of the pppd.  It does not send SIGHUP to 
# the modem... maybe this will work.
    /usr/sbin/pppd connect '/usr/lib/ppp/pppdial'  \
	 /dev/$DEVICE modem 38400 defaultroute -detach lock 
	sleep 5
	exit 0
) < /dev/$DEVICE > /dev/$DEVICE

# 	ipcp-accept-local



#    /usr/sbin/pppd connect '/usr/sbin/chat -v -f /usr/lib/ppp/login.scr '  \
#	 /dev/$DEVICE modem 38400 defaultroute -ip $L_IP: ipcp-accept-local \
# 	-detach lock 

