[ntp:questions] Local clock question with dialup connection

Bob Beers bob.beers at gmail.com
Fri Apr 20 12:50:24 UTC 2007


On 4/19/07, Nigel Henry <cave.dnb at tiscali.fr> wrote:

> The problems are with FC2. I know it's old, but I still receive all my mail on
> it, and use it daily. I think what I really need is a script that detects
> when an Internet connection is up and running, then starts ntpd. I'm not too
> clever with scripts. I'll ask around, and see if some kind hearted scripter
> can suggest something.

How about something like this in a root cronjob:

[[ $( ps axf | grep -c ntpd ) -eq 0 ]] && {
    SRV=( $(grep ^server /etc/ntp.conf ) )
    ping -c 3 -w 2 ${SRV[1]}
    [[ $? -eq 0 ] && /usr/sbin/ntpd -g
}

HTH,
-Bob



More information about the questions mailing list