#!/bin/sh
#
# Make devices and start daemons for dialup ppp

DEVICE=/dev/dp0
. /etc/dp.conf

rm -f $DEVICE
mknod $DEVICE c $4 0

rm -f $DPLOG_DIR/ID.dp
echo $1 > $DPLOG_DIR/ID.dp

#
# ifconfig selected interfaces
#
if [ -f $DPCONF_DIR/dp-if ]; then
	cat $DPCONF_DIR/dp-if | (
		while read IFNAME LOCAL REMOTE
		do
			if [ "`echo $IFNAME | cut -c1`"X != "#"X ]; then
				ifconfig $IFNAME $LOCAL $REMOTE up -trailers netmask +
			fi
		done
	)
fi

#
# Clear the log file - comment this out if you want
#
rm $DPLOG_DIR/dp.log

#
# start the daemon
#
if [ -f $DPBIN_DIR/dpd ]; then
	$DPBIN_DIR/dpd
fi

