From cc2d1c8575d0b50efe5d9449cac22e7749754d26 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 18 Oct 2011 12:56:12 -0500 Subject: 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. (cherry picked from commit 40c15167d2834c7eb246d8a4160609c16bfa7df7) --- templates/set/date/ntp/node.def | 1 + templates/set/date/ntp/node.tag/node.def | 7 +++++-- 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 ' 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 " " ${arr[@]} +run: sudo ntpdate -u $4 + -- cgit v1.2.3