summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-05-30 12:55:14 -0700
committerStig Thormodsrud <stig@vyatta.com>2009-05-30 12:55:14 -0700
commit6052886a6a06f8ef6ee0a35f3c9bb47d81e5d755 (patch)
treed2637a32a63cfdbbc813e92e25f16f51e0476dd2 /templates
parentab857f46cb19f9acdc53afb496ce6a13f3636b2f (diff)
parent78aef156293581ce5028ff22d752241cc2e9525b (diff)
downloadvyatta-cfg-system-6052886a6a06f8ef6ee0a35f3c9bb47d81e5d755.tar.gz
vyatta-cfg-system-6052886a6a06f8ef6ee0a35f3c9bb47d81e5d755.zip
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg-system into jenner
Diffstat (limited to 'templates')
-rw-r--r--templates/system/ntp-server/node.def24
1 files changed, 13 insertions, 11 deletions
diff --git a/templates/system/ntp-server/node.def b/templates/system/ntp-server/node.def
index f1318b28..c8e3a9f2 100644
--- a/templates/system/ntp-server/node.def
+++ b/templates/system/ntp-server/node.def
@@ -1,15 +1,17 @@
multi:
type: txt
help: Set name or IP address of Network Time Protocol (NTP) server
-update: if ! grep -q '^server $VAR(@) ' /etc/ntp.conf
- then sudo sh -c \
- "echo \"server $VAR(@) iburst\" >> /etc/ntp.conf;
- /usr/sbin/invoke-rc.d ntp restart"
- fi
-delete: if grep -q '^server.*$VAR(@) ' /etc/ntp.conf
- then sudo sed -i '/^server $VAR(@) /d' /etc/ntp.conf
- if grep -q '^server ' /etc/ntp.conf
- then sudo /usr/sbin/invoke-rc.d ntp restart
- else sudo /usr/sbin/invoke-rc.d ntp stop
- fi
+create: if ! grep -q '^server $VAR(@) ' /etc/ntp.conf
+ then sudo sh -c \
+ "echo \"server $VAR(@) iburst\" >> /etc/ntp.conf; \
+ /usr/sbin/invoke-rc.d ntp restart"
+ elif ! /usr/sbin/invoke-rc.d ntp status
+ then sudo /usr/sbin/invoke-rc.d ntp start
fi
+delete: if grep -q '^server $VAR(@) ' /etc/ntp.conf
+ then sudo sed -i '/^server $VAR(@) /d' /etc/ntp.conf
+ if grep -q '^server ' /etc/ntp.conf
+ then sudo /usr/sbin/invoke-rc.d ntp restart
+ else sudo /usr/sbin/invoke-rc.d ntp stop
+ fi
+ fi