#!/bin/sh
# 1995-05-22	program:  ppp-up
#		jmf
#
# a quick and dirty shell script that will keep a PPP session up (to avoid
# a connection timeout) by pinging a host every 8 minutes.
#
# We'll use the gateway server at vanderbilt for now.
HOST=123.45.56.789	# the host we'll periodically ping
SLEEP=8m		# how long we'll wait between pings

###############################################################################
#
# Set up a while loop that pings the host as long as the PID file exists.
# But first, make sure that the connection is still up.
#
if [ ! -e "/var/run/ppp0.pid" ]; then
	echo "
		* * * 	 PPP0 interface is not up!  * * * 
	     "
	exit 1
fi

while [ -e "/var/run/ppp0.pid" ]	# Now, set up the while loop.
do									# As long as the PID file exists
	ping -c 1 $HOST > /dev/null		# we'll ping the host once every 8 min.
	sleep $SLEEP
done
exit 0