[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Dialup script question



On Monday 07 May 2001 20:53, Kieren Diment wrote:
> My computer connects to the internet with the following dialup script
> at the moment:
>
> pon
> sleep 45s
> fetchmail
>
> I would like to get rid of the line sleep 45s and replace it with a
> command that starts up the fetchmail process once pon has successfully
> negotiated a connection to the internet (my understanding is that this
> is when the DNS is registered.  What would I put in line two to do
> this?

When pppd successfully establishes a connection, it runs /etc/ppp/ip-up.  
ip-up calls run-parts on everything in  /etc/ppp/up-up.d.  I just put this 
little script in there.  It starts fetchmail as a daemon and retrieves my 
mail every 5 minutes.

#!/bin/bash
/usr/bin/fetchmail -d 300 -L /var/log/fetchmail

Then in /etc/ppp/ip-down.d, this one kills fetchmail when the ppp connection 
goes down.

#!/bin/bash
/usr/bin/fetchmail -quit

Seems to work pretty well.

-- 
Bud Rogers <budr@sirinet.net>   http://www.sirinet.net/~budr
All things in moderation.  And not too much moderation either.



Reply to: