You can determine if ppp0 device exists at that moment and run sendmail and
fetchmail, like in following script:
--------------------------------------------------------------------------
#!/bin/sh
# Determine the device
if [ "$1" = "" ]; then
DEVICE=ppp0
else
DEVICE=$1
fi
# If the ppp0 pid file is present then the program is running.
if [ -r /var/run/$DEVICE.pid ]; then
sendmail -q
fetchmail
fi
---------------------------------------------------------------------------
You can run this script in background (after pon was running) from 30 to 30
seconds (for example) until ppp0 PID appears. Then sendmail and fetchmail make
their job and if its return exit code OK (see EXIT CODES from sendmail and
fetchmail mans) and if everything goes well, you can close de session (poff).
But tell me something, please! Can you retrieve your e-mails direct from
iname.com without using their web page? Do they have their own POP3 server?
Thanks,
Cata.
Mario Melendez Esquivel wrote:
>
> 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?
--
=/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\=
\ Don't believe all you hear, /
/ spend all you have, \
\ or sleep all you want. /
/=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\
\ Catalin Bucur, /
/ Hardware engineer. mailto:[EMAIL PROTECTED] \
=/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\_/^\=