#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin

. $1

if [ "foo$2" = "fooboot" -a ${ONBOOT} = "no" ]
then
	exit
fi

cat ${DIPSCRIPT} | sed -e "s/@@@local-ip@@@/${IPADDR}/g" \
                       -e "s/@@@remote-ip@@@/${REMIP}/g" \
                       -e "s/@@@modem-speed@@@/${SPEED}/g" \
                       -e "s/@@@phone-number@@@/${PHONE}/g" \
                       -e "s/@@@login-id@@@/${LOGIN}/g" \
                       -e "s/@@@password@@@/${PASSWORD}/g" \
                       -e "s/@@@mtu@@@/${MTU}/g" \
                       -e "s/@@@connect-string@@@/${CONNECT}/g" \
                       -e "s/@@@connection-type@@@/${CTYPE}/g" >/tmp/dip.$$

dip /tmp/dip.$$
rm /tmp/dip.$$

sleep 5

if [ "$DEDICATED" = "yes" ]; then
	watch-ppp $DEVICE &
fi
