diff options
author | An-Cheng Huang <ancheng@sydney.vyatta.com> | 2007-10-19 11:26:15 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@sydney.vyatta.com> | 2007-10-19 11:26:15 -0700 |
commit | 07183520f3f4d2f89e526055db418046d0d2450f (patch) | |
tree | 7968eac48a0a57ff97ec4769d999bf31348a2a12 /templates/system/ntp-server/node.def | |
parent | 66b621cf7759c3448ae8bfe7d7479fb13ea04b65 (diff) | |
download | vyatta-cfg-quagga-07183520f3f4d2f89e526055db418046d0d2450f.tar.gz vyatta-cfg-quagga-07183520f3f4d2f89e526055db418046d0d2450f.zip |
move "system" configuration templates/scripts from vyatta-cfg.
Diffstat (limited to 'templates/system/ntp-server/node.def')
-rw-r--r-- | templates/system/ntp-server/node.def | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/system/ntp-server/node.def b/templates/system/ntp-server/node.def new file mode 100644 index 00000000..230dd313 --- /dev/null +++ b/templates/system/ntp-server/node.def @@ -0,0 +1,17 @@ +multi: +type: txt +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" |