summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-12 18:37:10 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-12 18:37:10 -0800
commita7a030e26532dcd7d8e90732eafefbcd9314bd05 (patch)
tree17fb1f59865cc641e8b21545e773a64fc31763af /templates
parent336ac34391efd20648ef710b953fa94d0551f299 (diff)
downloadvyatta-cfg-system-a7a030e26532dcd7d8e90732eafefbcd9314bd05.tar.gz
vyatta-cfg-system-a7a030e26532dcd7d8e90732eafefbcd9314bd05.zip
Avoid sleep in ntp restart
If ntpd isn't already running, use the start rather than the restart target to save 2 seconds in boot time.
Diffstat (limited to 'templates')
-rw-r--r--templates/system/ntp-server/node.def7
1 files changed, 5 insertions, 2 deletions
diff --git a/templates/system/ntp-server/node.def b/templates/system/ntp-server/node.def
index 485cf774..a063431f 100644
--- a/templates/system/ntp-server/node.def
+++ b/templates/system/ntp-server/node.def
@@ -2,9 +2,12 @@ multi:
type: txt
help: Set name or IP address of Network Time Protocol (NTP) server
update:sudo sh -c \
- "touch /etc/ntp.conf
- if ! grep -q 'server.*$VAR(@)' /etc/ntp.conf; then
+ "if ! grep -q 'server.*$VAR(@)' /etc/ntp.conf; then
echo \"server $VAR(@) iburst dynamic\" >> /etc/ntp.conf
+ fi
+ if [ $(pgrep -c ntpd) -eq 0 ]; then
+ /usr/sbin/invoke-rc.d ntp start
+ else
/usr/sbin/invoke-rc.d ntp restart
fi"
delete:sudo sh -c \