One way you might be able to do it is will the sleep command.  It will
pause for a given amount of time, like sleep 30 will have the console just
'sit' there doing 'nothing'.  So if on average if it takes 2 minutes for
the connection to your isp to go though you could do a 
pon MyISP
sleep 120
sendmail -q

and so forth, man sleep, there is probably better ways to do this, but
this could work in a way.  But if you got a busy signal at your isp and it
took 2 minutes and 30 seconds it would break the script

There might be a way to do it will an if statement, as,  if pon is in ps
aux then sendmail -q , that would work in THEROY but not so sure about
realworld.  The first problem I see with this is that pon would show up as
a process wheather of not it is connnected to your isp, it just maybe
(re)dialing.  The second problem is that it only would test the connection
once if good it would work, if the connection didn't go though, say busy
singal it would break the script.

As for seeing if pon is running and that your connected is up, < it would
be hard to convert this into a boolean expression?

Hope this helps
Bud
> 
> Every morning, I perform the same routine: open up my dialup connection,
> send unsent messages, get messages from my ISP and disconnect. I would like
> to automate this procedure in a script.
> 
> The problem is this: I write it up in a script like so:
> 
> pon MyISP
> sendmail -q
> fetchmail
> poff
> 
> But since Linux executes in background, what happens is that pon is left to
> dial in the background, sendmail is executed, and since no dialup connection
> exists (yet) sendmail fails, fetchmail fails, and poff kills the dialup in
> progress.
> 
> How can I halt the script until the connection is up and running, and better
> yet: how do I keep it from executing poff until fetchmail is done?
> 
> -----
> //\/\ario //\/\elendez- TI2DLL
> [EMAIL PROTECTED]
> http://desvelo.cjb.net
> Happily running Linux since 10/28/98
> 

Reply via email to