[ntp:questions] adsl link

[ntp:questions] adsl link

Post by Brad Knowl » Wed, 17 Sep 2003 23:37:58

You'd also lose your drift file, etc....

That's easy to solve. Instead of using awk, use grep piped to
sed. That would allow you to do things like:

grep -i '^server' /etc/ntp.conf | grep -vi '^server 127.127'
| sed 's/^server/addserver/'


grep -i '^peer' /etc/ntp.conf | sed 's/^peer/addpeer/'

Thus, leaving the rest of the configuration line unchanged.

For the unconfig stuff, you should probably leave configured any
"local" servers, i.e., servers that are on the same network according
to the IP address/netmask of the affected interface.

My understanding is that Dave hates ntpdc. We're trying to work
on a way to incorporate all that functionality into ntpq, but I don't
know whether or not we'll be able to make it before ntpdc is shot

Brad Knowles, < XXXX@XXXXX.COM >

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
-Benjamin Franklin, Historical Review of Pennsylvania.

GCS/IT d+(-) s:+(++)>: a C++(+++)$ UMBSHI++++$ P+>++ L+ !E-(---) W+++(--) N+
!w--- O- M++ V PS++(+++) PE- Y+(++) PGP>+++ t+(+++) 5++(+++) X++(+++) R+(+++)
tv+(+++) b+(++++) DI+(++++) D+(++) G+(++++) e++>++++ h--- r---(+++)* z(+++)

[ntp:questions] adsl link

Post by per » Sun, 21 Sep 2003 19:06:52

In article < XXXX@XXXXX.COM > Brad Knowles
< XXXX@XXXXX.COM > writes:

You certainly don't lose the drift *file*, its whole purpose is being
there across ntpd restarts (including reboots), but you do lose the
current state.

grep is basically a small subset of awk functionality, and awk can of
course do trivial sed operations like that one too, so this could easily
be a single awk instead of two greps and a sed. But more important is
that addserver (and addpeer) has a different and more restrictive syntax
than the config file counterpart, and allows only a subset of the config
file options - i.e. the above doesn't work in anything but "the very
simplest of server and peer configurations" either.

--Per Hedeland