#!/bin/bash
#
# Script for finding if your ppp connected or not...
# Part of the pppsetup package. (10-27-97)

if [ -s /etc/ppp/connect-errors ] && ifconfig | grep P-t-P >/dev/null &&
! ifconfig | grep "inet addr:0.0.0.0" >/dev/null
then
        echo "* YES! you're connected... *"
if ! grep "connect-errors" /etc/ppp/connect-errors >/dev/null 
then	
        tail -n 1 /etc/ppp/connect-errors
exit
else
        tail -n 2 /etc/ppp/connect-errors
exit
fi
fi

if ifconfig | grep P-t-P >/dev/null && ! ifconfig | grep "inet addr:0.0.0.0" >/dev/null
then
	echo "* YES! you're connected... *"
exit       
else
	echo "* NO! you're not connected... *"
exit
fi

