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

Re: getting time from timeserver on a dial-up



Kevin.Bewley@camr.org.uk wrote:
> Hi,
>    I'm using Debian 3.0r1 stable on a dialup in the UK. I'm using PAP
> authentication that CHAT's to the modem then launches pppd and away we go.
> What I'd like is for the machine to check and set (if necessary) the system
> clock based on the time from one of the many timeservers on the internet.
> 
> What package do I need to do this?
> 
> How do I make it autorun once pppd has got the ppp connection up and
> running (I use the pon script)
> 

This is probably not a very elegant solution, but here is what I do:

install ntpdate package

Place the following into a script that runs when ppp comes up, or make it
its own script in /etc/ppp/ip-up.d/set_time


# Let's sync our watches when we go online
ntpdate clock.name.com
sleep 10s
ntpdate clock.name.com


-- 
David Raeker-Jordan
mailto:rkrjrdn@epix.net
GnuPG key: 1024D/CD956608

Attachment: pgpRy474rwP8Q.pgp
Description: PGP signature


Reply to: