summaryrefslogtreecommitdiff
path: root/templates/system/name-server/node.def
blob: ff6ddf2ec89a335531469710c3e3b4ca7a531b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
multi:
type: ipv4
help: "Configure domain name server"
update: "sudo sh -c \"touch /etc/resolv.conf && \
if grep -q '$(@)' /etc/resolv.conf; then \
  exit 0; \
else \
  echo \\\"nameserver\t $(@)\\\" >> /etc/resolv.conf; \
fi && \
if [ -f /etc/ntp.conf ] && grep -q 'server' /etc/ntp.conf; then \
  /usr/sbin/invoke-rc.d ntp restart; \
fi\" "
delete: "sudo sh -c \"touch /etc/resolv.conf && \
sed -i '/$(@)/d' /etc/resolv.conf && \
if [ -f /etc/ntp.conf ] && grep -q 'server' /etc/ntp.conf; then \
  /usr/sbin/invoke-rc.d ntp restart; \
fi\" "