[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ppp



Robert Speed wrote:
> 
> It's a bit of a clumsy hack, but you could try greping ifconfig and
> looking for the ppp0 connection.
> Then when it's established, run sendmail -q, etc.
> Sort of something like;
> 
> WaitLoop=10
> while test $WaitLoop -ne 0 ; do
>   WaitLoop=$[$WaitLoop-1]
>   LineUp=`ifconfig |grep "ppp0" |grep -c "158.152.1.222"`
>   if test $LineUp = "1"
>   then
>     WaitLoop=0
>   else
>     sleep 5
>   fi
> done
> 
> HTH

I like this one better; it returns the IP address of the ppp0
interface, and exits when ppp0 is not up (handy for ipchains scripts):

DEV=ppp0
IP=`ifconfig $DEV | grep "inet addr:" | \
        awk -F: {'print $2'} | cut -d\  -f 1`
if [ -z "${IP}" ]; then
        exit 1
fi

Jules
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.