Subject: Re: How do I get PPP progress while connecting.
To: None <rfischer@hac2arpa.hac.com>
From: Ken Nakata <kenn@echna.or.jp>
List: port-mac68k
Date: 03/28/1998 10:47:54
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?  
> 
> Something similar to this:

> dialing...
> connect...

These are typically dealt with by ``chat'' program which doesn't have
such an elaborate reporting mechanism.  However, you can make it
report some things by adding REPORT directives in your chat script.
Mine has the following five directives:

REPORT "CARRIER "
REPORT "PROTOCOL"
REPORT BUSY
REPORT "NO CARRIER"
REPORT "NO DIAL"

In Bill's PPP kit, I believe reports are saved into /tmp/ppp-report or
something like that.  When I want to see that while running the ppp-up
script, I do:

tail -f /tmp/ppp-report

so I can see something like:

chat:  Mar 28 10:36:05 BUSY
chat:  Mar 28 10:38:13 CARRIER 28800
chat:  Mar 28 10:38:13 PROTOCOL: LAP-M

as the lines are logged to the file.

I guess you can add the tail line at the end of ppp-up script in which
case, however, you must terminate the script by pressing control-C
each time connection is established.

> logging on...

Logging in (*) is done by either chat or pppd depending on your ISP
(the traditional login(username)/password prompts -> chat, PAP/CHAP ->
pppd).  If it's chat, you can use REPORT here, too, but if it's pppd,
I don't believe there's any way to make pppd report it unless you hack
the pppd source.

*: In UNIX world we usually say we log ``in'' whereas some other
people say they log ``on''.  I prefer to stick to the UNIX tradition
here.

> starting ppp...
> PPP up, your IP address is  xxx.xxx.xx.xxx

The last information is echoed by pppd to the console.  I usually keep
an ``xterm -C'' window open so I can see things like:

Mar 28 10:38:15 quark pppd[19567]: Connect: ppp0 <--> /dev/tty01
Mar 28 10:38:18 quark pppd[19567]: local  IP address 210.175.55.64
Mar 28 10:38:18 quark pppd[19567]: remote IP address 210.175.55.8

All of the above talk something *similar* to what you want but not
exactly the same.  To do exactly what you said, it may be necessary to
replace the simple-minded chat program with something more powerful,
such as ``expect''.

Cheers,

Ken