summaryrefslogtreecommitdiff
path: root/templates/system/name-server/node.def
blob: fce5cac9eba290d51e6a9b1e7e0895edbafa5fe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
multi:
type: ipv4
help: Set Domain Name Server (DNS)
update: sudo sh -c "touch /etc/resolv.conf &&
if grep -q \"$VAR(@)\($\|[[:space:]]\)\" /etc/resolv.conf; then
  exit 0;
else
  mv -f /etc/resolv.conf /etc/old_resolv.conf &&
  echo \"nameserver      $VAR(@)\" >> /etc/resolv.conf &&
  cat /etc/old_resolv.conf >>  /etc/resolv.conf;
fi &&
if [ -d /opt/vyatta/config/active/service/dns/forwarding ]; then
   /opt/vyatta/sbin/vyatta-dns-forwarding.pl --update-dnsforwarding >&/dev/null;
fi &&
if [ -f /etc/ntp.conf ] && grep -q 'server' /etc/ntp.conf; then
  /usr/sbin/invoke-rc.d ntp restart >&/dev/null;
fi"
delete:expression: "sudo sh -c \"touch /etc/resolv.conf && \
sed -i '/$VAR(@)$/d' /etc/resolv.conf && \
if [ -f /etc/ntp.conf ] && grep -q 'server' /etc/ntp.conf; then \
  /usr/sbin/invoke-rc.d ntp restart >&/dev/null; \
fi && \
if [ -d /opt/vyatta/config/active/service/dns/forwarding ]; then \
      /opt/vyatta/sbin/vyatta-dns-forwarding.pl --update-dnsforwarding >&/dev/null; \
fi\" "