Ajout : etc/sv/sympa/ .
[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 for zone in $(find "$tool"/etc/nsd3/zone.d \
16 -mindepth 1 -maxdepth 1 -type f \
17 -false ${@:+$(printf -- '-or -name %s.conf\n' "$@")} \
18 -printf '%f\n')
19 do zone=${zone%.conf}
20 if test -e "$tool"/etc/nsd3/zone.d/"$zone".zone.m4
21 then m4 \
22 --define=ZONE_DOMAIN=$zone \
23 --define=ZONE_SERIAL=$(cd "$tool" && git log -1 --format="%ct" -- etc/nsd3/zone.d/"$zone".zone.m4) \
24 --define=VM_IP4=$vm_ipv4 \
25 "$tool"/etc/nsd3/zone.d/"$zone".zone.m4
26 else cat "$tool"/etc/nsd3/zone.d/"$zone".zone
27 fi |
28 sudo install -m 440 -o root -g nsd /dev/stdin \
29 /etc/nsd3/zone.d/"$zone".zone
30 cat <<-EOF
31 zone:
32 name: $zone
33 zonefile: /etc/nsd3/zone.d/$zone.zone
34 $(cat "$tool"/etc/nsd3/zone.d/"$zone".conf)
35 EOF
36 done
37 } |
38 sudo install -m 640 -o root -g nsd /dev/stdin \
39 /etc/nsd3/nsd.conf
40
41 rule runit_sv_start "$sv"
42 sudo nsdc rebuild
43 sudo nsdc reload
44 #sudo nsdc notify