On 16 February 2006 23:20, James wrote:
> Uwe Thiem <uwix <at> iway.na> writes:
> > With a dial-up connection, you haven't much chance other than connecting
> > to a time server when your connection is up. I do it automatically
> > in /etc/ppp/ip-up.
>
> Hey, this is cool, do you have an example 'ip-up' config file? I
> have used ppp quite a lot to talk to industrial equipment, so any
> other examples of things you can fire up once a ppp link is
> established, is of keen interest to me....
>
> Does this work with any ppp/ppp_dialer or just a specific one?
> wvdial is what I have used, but, I'm open to kppp or any
> other robust ppp tools, as I usually manually fire up software
> manually once the link is established. Hopefully, this and other
> config files can exist simultaneously, as I need to routinely
> connect  with ppp to different closed( non internet) networks....
> When I use PPP, it may be the primary link or used as a backup,
> remote connection.

It works with any dialer that uses pppd as back-end. As soon as the IP layer 
is up, the script /etc/ppp/ip-up gets called. You can put any command into it 
for which it makes sense to be executed when the connection is established.

My customised part of ip-up looks like this:

/sbin/shorewall start > /var/log/fw.start 2>%1
/etc/ppp/ntp
/usr/bin/fetchmail -f /etc/fetchmailrc
/usr/sbin/exim -qff

The first line starts my firewall. The second one calls another script that 
handles time synchronisation. The third one fetches my emails and the last 
one forces exim to send whatever is lying in its queue.

The script "ntp":

#! /bin/sh

/usr/sbin/ntpdate ntp.ipb.na > /dev/null 2>&1
RETURNCODE=$?

if [ "$RETURNCODE" = "0" ]; then
  /sbin/hwclock -u -w
fi


It synchronises with an ntp server nearby. On success, it writes the result to 
my hardware clock.

>
> I also, I routinely establish ppp links, over RS232 serial ports, to
> a variety of embedded system, so any other ppp ideas, config files
> and code snippets are of keen interest likewise. Sometimes I just talk
> to the embedded web server in a device over the ppp-serial link.

Doesn't matter whether it uses a modem, just a serial line or any other 
media, /etc/ppp/ip-up is executed as soon as the two ppp processes have 
established an IP connection.

When I wrote a book, I got paranoid about backups. So ip-up sent the current 
state of my manuscript to a server at a different physical location every 
time I went on-line. 

Uwe

-- 
Why do consumers keep buying products they will live to curse?
-- 
gentoo-user@gentoo.org mailing list

Reply via email to