Subject: Re: How do I get PPP progress while connecting.
To: Port-Mac68K Mailing List <port-mac68k@NetBSD.ORG>
From: Mason Loring Bliss <mason@acheron.middleboro.ma.us>
List: port-mac68k
Date: 03/29/1998 18:09:50
On Sat, Mar 28, 1998 at 10:47:54AM +0900, Ken Nakata wrote:

> On Fri, 27 Mar 1998 16:27:08 -0800,
> Roger Fischer <rfischer@hac2arpa.hac.com> wrote:
> > 
> > I'm using the Wstudenmund PPP scripts.  Does anybody know if there is a
> > way I can monitor the connection status while dialing ensues?  

I don't know if this will help you, but here's what I use:

  echo -n "Waiting for IP address"
  while [ `/sbin/ifconfig ppp0 | tail -1 | cut -c 7-14` = "0.0.0.0" ]
  do
    sleep 5
    echo -n "."
  done
  echo "got one."

I guess the while could be a little cleaner, but I've never really learned
to use sed or awk... Anyway, something like this will wait until you've
been assigned a PPP address, at which time the script continues, doing
whatever you like. Using something like this makes it easy to automate
scripts that run stuff that wants to be run with a live TCP connection.

-- 
Mason Loring Bliss...mason@acheron.middleboro.ma.us...www.webtrek.com/mason
"In the drowsy dark cave of the mind dreams build their nest with fragments
 dropped from day's caravan."--Rabindranath Tagore...awake ? sleep : dream;