On Thu, 18 Mar 1999, Steve Crane wrote:
>
> >
> > Hi All,
> >
> > I am running SuSE 5.3 and have become quite tired of using Netscape
> > Communicator for e-mail. I am now using sendmail and fetchmail with
> > mutt. I have created the following script:
> >
> > /etc/suseppp/scripts/ppp-up generic
> > sendmail -q
> > fetchmail -v >> /var/log/fetchmail
> > /etc/suseppp/scripts/ppp-down
> >
> > to send and receive but it has a problem. The commands after the ppp-up
> > execute immediately and the entire script finishes (with errors from
> > sendmail & procmail) before the modem even begins to connect.
> >
> > How can I pause the script and test that the connection was made before
> > continuing with execution?
That's what ip-up and ip-down are for. Man pppd and read the sections on
/etc/ppp/ip-up and /etc/ppp/ip-down. ip-up runs when pppd successfully
connects. ip-down runs when pppd exits. Here's what I have in ip-up.
#!/bin/bash
echo "$(date) $1 up" >> var/log/ppplog
/root/bin/ckmail
The $1 in the echo line is the interface, ppp0, returned by ip-up. The
result is a line in the logfile like this:
Thu Mar 18 21:41:18 CST 1999 ppp0 up
Other parameters $2, $3, etc will return connection speed, local and remote
IP addresses, etc.
/root/bin/ckmail is just a script that runs fetchmail and does some other
things. Then in ip-down I have
#!/bin/bash
/usr/bin/killall ckmail
echo "$(date) $1 down" >> var/log/ppplog
if [ -e /tmp/pppman ] || [ -e /tmp/pppcron ]; then
/usr/sbin/ppp-on
fi
Which among other things will try to bring the link back up if it goes down
prematurely. This is pretty simple stuff, but you can do almost anything.
--
Bud Rogers <[EMAIL PROTECTED]> http://www.sirinet.net/~budr/zamm.html
--
To get out of this list, please send email to [EMAIL PROTECTED] with
this text in its body: unsubscribe suse-linux-e
Check out the SuSE-FAQ at http://www.suse.com/Support/Doku/FAQ/ and the
archive at http://www.suse.com/Mailinglists/suse-linux-e/index.html