Ajout : etc/nsd3/zone.d/ : NS secondaire : ns6.gandi.net .
[lhc/ateliers.git] / etc / sv / nsd3 / configure.sh
1 rule apt_get_install nsd
2 rule insserv_remove nsd3
3
4 sudo rm -rf \
5 /etc/nsd3/zone.d
6 sudo install -d -m 750 -o root -g nsd \
7 /etc/nsd3/zone.d
8 {
9 cat <<-EOF
10 server:
11 ip-address: $vm_ipv4
12 ip4-only: yes
13 EOF
14 cat "$tool"/etc/nsd3/nsd.conf
15 local conf
16 for conf in "$tool"/etc/nsd3/zone.d/*.conf
17 do conf=${conf#"$tool"/etc/nsd3/zone.d/}
18 local domain=${conf%.conf}
19 if test -e "$tool"/etc/nsd3/zone.d/"$domain".zone.m4
20 then m4 \
21 --define=ZONE_DOMAIN=$domain \
22 --define=ZONE_SERIAL=$(cd "$tool" && git log -1 --format="%ct" -- etc/nsd3/zone.d/"$domain".zone.m4) \
23 --define=VM_IP4=$vm_ipv4 \
24 "$tool"/etc/nsd3/zone.d/"$domain".zone.m4
25 else cat "$tool"/etc/nsd3/zone.d/"$domain".zone
26 fi |
27 sudo install -m 440 -o root -g nsd /dev/stdin \
28 /etc/nsd3/zone.d/"$domain".zone
29 cat <<-EOF
30 zone:
31 name: $domain
32 zonefile: /etc/nsd3/zone.d/$domain.zone
33 $(cat "$tool"/etc/nsd3/zone.d/"$conf")
34 EOF
35 done
36 } |
37 sudo install -m 640 -o root -g nsd /dev/stdin \
38 /etc/nsd3/nsd.conf
39 sudo nsdc rebuild