#!/bin/sh
######################################################################
#
# This script is part of the PPP System designed and used by
# Preston A. Elder of Shadow Realm.  If you have any problems
# with this system please email prez@antisocial.com.
#
# This system is publically distributable via. the GNU license.
#
######################################################################
#
# Check to see if PPP link is active
#
. /etc/ppp-settings

if [ -z "${1}" ]; then
	NETDEV="`${basePPP}/curdef`"
else
	NETDEV="$1"
fi
if [ -z "${NETDEV}" ]; then NETDEV="${baseDEV}"; fi

if [ -r ${basePID}/$NETDEV.pid ]; then
	pid=`cat ${basePID}/$NETDEV.pid`
	if [ ! "$pid" = "" ]; then
		ps ax | grep $pid >/dev/null
		if [ "$?" = 0 ]; then
			exit 0
		fi
	fi
fi
exit 1
		