#!/bin/sh

PORT=$1

if [ "$PORT" = "" ]
then
	PORT=0
fi

if [ -f /var/run/ppp$PORT.pid ]
then
	kill -INT `cat /var/run/ppp$PORT.pid`
	echo "PPP terminated"
else
	echo "PPP not running"
fi

echo
echo "Last connection statistics:"
echo
echo "Begin: " `grep "ipcp: up" /var/adm/messages | tail -1 | cut -c8-15`
echo "End:   " `grep "ipcp: down" /var/adm/messages | tail -1 | cut -c8-15`
echo

