[pkg-ntp-maintainers] Bug#376019: /etc/default/ntpdate:NTPSERVERS could be initialised from ntp.conf

JH ntp376019debian at s6.sector6.net
Sat Jul 8 23:11:18 UTC 2006


On 29-June-2006, martin f krafft <madduck at debian.org> wrote:
> I use the following in /etc/default/ntpdate with success:
>
>   NTPSERVERS="$(sed -rne 's/^server ([-_.[:alnum:]]+)$/\1/p'
>     /etc/ntp.conf 2>/dev/null || echo echo {0,1,2,3}.debian.pool.ntp.org)"
>   # override:
>   #NTPSERVERS="time.ethz.ch"
>
> This works like a charm and I now can manage the servers only in ntp.conf.

I was wondering why this returned zero lines from my ntp.conf, until I
noticed that some lines have a TAB or a pair of blanks.

Also, the '.' does not have the desired effect; a regex of '\.'
corresponds to the <hname> character set of RFC952.  So we want:


NTPSERVERS="$(sed -rne 's/^server[[:space:]]+([-_\.[:alnum:]]+)$/\1/p'  ...

(BTW, the regex at the end of bug 283386 suffers similar lossage.)


    Cheers,
    JH



More information about the pkg-ntp-maintainers mailing list