summaryrefslogtreecommitdiff
path: root/templates/system/ntp-server/node.def
blob: 230dd31345071998cad10127b9ffea274e5561b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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"