[ntp:questions] Re: ntpd looses sync, I must always restart: please help

Luca luca at pacor.de
Fri Oct 31 10:45:04 UTC 2003


"Maarten Wiltink" <maarten at kittensandcats.net> wrote in message news:<3fa1ad25$0$58700$e4fe514c at news.xs4all.nl>...
> "Harlan Stenn" <stenn at maccarony.ntp.org> wrote in message
> news:bns8ea$l4v$1 at dewey.udel.edu...
> > If somebody finds the script I'd appreciate somebody adding the script
> > and some simple instruction on how to use it on twiki.ntp.org.
> 
> You mean this one? (I'm sure Jan Ceuleers <janspam.ceuleers at computer.org>
> wouldn't mind.)
> 
> === begin script
> #!/bin/sh
> #
> # reconfigureNtpd, written by Jan Ceuleers, March 2003
> #
> # Usage: reconfigNtpd | ntpdc
> #
> 
> ###
> #
> # Get keyid and password from /etc/ntp/keys
> #
> ###
> set -- $(grep "^[[:digit:]]" < /etc/ntp/keys)
> echo keyid $1
> echo passwd $3
> 
> ###
> #
> # Derive unconfig commands from ntpdc output
> #
> ###
> ntpdc -n -p | awk '!/==/ && !/^ / { if (substr($1,2) !~ /^127.127./)
> print "unconfig " substr($1,2) }'
> 
> ###
> #
> # Derive addserver commands from /etc/ntp.conf
> #
> ###
> awk '/^server[[:blank:]]/ { if ($2 !~ /^127.127./) print "addserver " $2
> }' /etc/ntp.conf
> 
> ###
> #
> # Derive addpeer commands from /etc/ntp.conf
> #
> ###
> awk '/^peer[[:blank:]]/ { print "addpeer " $2 }' /etc/ntp.conf
> 
> echo quit
> === end script

and which is the best way to use this?


All the best
Luca



More information about the questions mailing list