Summary: | ntp initscript calculates a wrong NTPDATESERVERS | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Christian Birchinger (RETIRED) <joker> |
Component: | Current packages | Assignee: | SpanKY <vapier> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | High | ||
Version: | 1.4_rc1 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Christian Birchinger (RETIRED)
2002-12-22 23:44:52 UTC
This works better: grep '^\(server\|peer\)' Ok my final sugestion is: grep -m 1 '^\(server\|peer\)[[:space:]]' /etc/ntp.conf | awk '{print $2}' -m 1 takes care that you only have one match and not mutliline output which breaks on ntpdate. no * after [[:space:]] because with * it also means zero spaces is ok which is wrong because at leats one space is mandatory. The only alternative would be [[:space:]][[:space:]]* but that's really not needed in this case. i fixed the [] in cvs a while ago multiline server passing to ntpdate works over here ... /etc/ntp.conf: server 199.165.76.11 server ntp-ua.usno.navy.mil cmd run: ntpdate `egrep '^(server|peer)[[:space:]]*' /etc/ntp.conf | awk '{print $2}'` the * was used because the rc script used to be using grep ... i forgot that literals were ignored when using regular grep ... so, i changed the '*' to a '+' ... and ill add the -m 1 even though it works for me :p actually i lied, i wont add -m 1 ... multiline works over here, and it allows ntpdate to fall back to other servers if the user specified them ... |