Waiting for call setup - (newbie)

Waiting for call setup - (newbie)

Post by Peter Buijsma » Sat, 08 Apr 2000 04:00:00



Hi,

I've got a RH6.0 machine, that can remote dial-in to my ISP.
Every time the system connects, I want to perform some tasks that can
only be performed AFTER the system has succesfuly connected.

Currently, my dial-script looks something like this:

=====
#!/bin/bash

# Check if link is up
if [ -r /var/run/ppp0.pid ]; then
  echo 'ERROR: Link is up!'
  exit 1
fi

# Link is not up, dial to ISP
pppd /dev/ttyS0 115200 connect /etc/ppp/ISP-chat-script &
<perform some other tasks>
=====

However, the scripts continues after calling the pppd, and the other
tasks fail because of the fact the call has not been setup, no DNS is
available and no host is reachable.

How can I make the script wait until a connection has been setup (or,
wait just 20 seconds and continue as that would be OK for me too)???

Thanks!

--
Peter

 
 
 

Waiting for call setup - (newbie)

Post by Gregory D. Horn » Sat, 08 Apr 2000 04:00:00


Try using EXPECT.  Works well in most every situation.  I am not an EXPECT guru
so you'll have to read up on it.

> Hi,

> I've got a RH6.0 machine, that can remote dial-in to my ISP.
> Every time the system connects, I want to perform some tasks that can
> only be performed AFTER the system has succesfuly connected.

> Currently, my dial-script looks something like this:

> =====
> #!/bin/bash

> # Check if link is up
> if [ -r /var/run/ppp0.pid ]; then
>   echo 'ERROR: Link is up!'
>   exit 1
> fi

> # Link is not up, dial to ISP
> pppd /dev/ttyS0 115200 connect /etc/ppp/ISP-chat-script &
> <perform some other tasks>
> =====

> However, the scripts continues after calling the pppd, and the other
> tasks fail because of the fact the call has not been setup, no DNS is
> available and no host is reachable.

> How can I make the script wait until a connection has been setup (or,
> wait just 20 seconds and continue as that would be OK for me too)???

> Thanks!

> --
> Peter


 
 
 

Waiting for call setup - (newbie)

Post by Clifford Kit » Sat, 08 Apr 2000 04:00:00



> I've got a RH6.0 machine, that can remote dial-in to my ISP.
> Every time the system connects, I want to perform some tasks that can
> only be performed AFTER the system has succesfuly connected.

That's what /etc/ppp/ip-up is for.  Read man pppd.

--

/* For every credibility gap, there is a gullibility fill.
                -- R. Clopton */