diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-17 18:45:17 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-17 18:45:17 -0700 |
commit | be79ca9ff0b67565870a18fa2ddadd09deb934a1 (patch) | |
tree | f54f40c106e66652fada7f08b9117d4753b6f65b /templates | |
parent | 8dc3dcf797dee1b498157f986619524b0caff182 (diff) | |
download | vyatta-cfg-be79ca9ff0b67565870a18fa2ddadd09deb934a1.tar.gz vyatta-cfg-be79ca9ff0b67565870a18fa2ddadd09deb934a1.zip |
use the default init scripts from ntp and sysklogd
Diffstat (limited to 'templates')
-rw-r--r-- | templates/system/ntp-server/node.def | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/templates/system/ntp-server/node.def b/templates/system/ntp-server/node.def index 9f828e1..230dd31 100644 --- a/templates/system/ntp-server/node.def +++ b/templates/system/ntp-server/node.def @@ -1,16 +1,17 @@ multi: type: txt -help: "IP address of NTP server" -# should help be "domain name" instead of "ip address", or change type to ipv4? -create: "sh -c \"touch /etc/ntp/ntp.conf && \ -if ! grep -q 'server.*$(@)' /etc/ntp/ntp.conf; then \ -echo \\\"server $(@)\\\" >> /etc/ntp/ntp.conf && \ -/opt/vyatta/sbin/ntpd.init restart; fi\" " -update: "sh -c \"touch /etc/ntp/ntp.conf && \ -if ! grep -q 'server.*$(@)' /etc/ntp/ntp.conf; then \ -echo \\\"server $(@)\\\" >> /etc/ntp/ntp.conf && \ -/opt/vyatta/sbin/ntpd.init restart; fi\" " -delete: "sh -c \"touch /etc/ntp/ntp.conf && \ -if grep -q 'server.*$(@)' /etc/ntp/ntp.conf; then \ -sed -i '/server $(@)/d' /etc/ntp/ntp.conf && \ -/opt/vyatta/sbin/ntpd.init restart; fi\" " +help: "Name or IP address of NTP server" +update: "touch /etc/ntp.conf && \ +if ! grep -q 'server.*$(@)' /etc/ntp.conf; then \ + echo \"server $(@)\" >> /etc/ntp.conf && \ + /usr/sbin/invoke-rc.d ntp restart; \ +fi" +delete: "touch /etc/ntp.conf && \ +if grep -q 'server.*$(@)' /etc/ntp.conf; then \ + sed -i '/server $(@)/d' /etc/ntp.conf && \ + if grep -q '^server ' /etc/ntp.conf; then \ + /usr/sbin/invoke-rc.d ntp restart; \ + else \ + /usr/sbin/invoke-rc.d ntp stop; \ + fi; \ +fi" |