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

Maarten Wiltink maarten at kittensandcats.net
Fri Oct 31 00:30:29 UTC 2003


"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

Groetjes,
Maarten Wiltink





More information about the questions mailing list