summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-10-18 12:56:12 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-10-18 12:56:12 -0500
commit40c15167d2834c7eb246d8a4160609c16bfa7df7 (patch)
treed033d574afb8e86045bf65f9a0062fe50a5e7530
parentccf2a40b2d30860618c45d6bd8a73eed8638fdd4 (diff)
downloadvyatta-op-40c15167d2834c7eb246d8a4160609c16bfa7df7.tar.gz
vyatta-op-40c15167d2834c7eb246d8a4160609c16bfa7df7.zip
Bugfix 5806, 7552: Fix set date ntp node.def to list proper servers from configuration, and run on unprivledged ports so the commands work at the same time the ntp service is running.
-rw-r--r--templates/set/date/ntp/node.def1
-rw-r--r--templates/set/date/ntp/node.tag/node.def7
2 files changed, 6 insertions, 2 deletions
diff --git a/templates/set/date/ntp/node.def b/templates/set/date/ntp/node.def
index 0b8705c..9235d2e 100644
--- a/templates/set/date/ntp/node.def
+++ b/templates/set/date/ntp/node.def
@@ -1 +1,2 @@
help: Set system date and time from Network Time Protocol (NTP) server
+run: sudo ntpdate -u 0.vyatta.pool.ntp.org
diff --git a/templates/set/date/ntp/node.tag/node.def b/templates/set/date/ntp/node.tag/node.def
index 7cf543c..92e0533 100644
--- a/templates/set/date/ntp/node.tag/node.def
+++ b/templates/set/date/ntp/node.tag/node.def
@@ -1,3 +1,6 @@
help: Set system date and time with given NTP server
-allowed: echo -n '<hostname> <x.x.x.x> ntp.vyatta.com'
-run: sudo ntpdate ${4:-ntp.vyatta.com}
+allowed: local -a arr
+ eval "arr=($(cli-shell-api listEffectiveNodes system ntp server))"
+ echo -n "<hostname> <x.x.x.x>" ${arr[@]}
+run: sudo ntpdate -u $4
+