aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-07 09:25:36 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-07 09:25:36 +0100
commit199c42f56eda6416d7094ce987124049ae3d8fde (patch)
tree1370f632edcb2ccf70a8e579c035e2503ec3e475 /Makefile
downloaddns-199c42f56eda6416d7094ce987124049ae3d8fde.tar.gz
dns-199c42f56eda6416d7094ce987124049ae3d8fde.tar.bz2
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3cd43c7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+NSDIFF= nsdiff
+NSDIFFFLAGS= -Sserial -s hemlock.eden.le-fay.org
+DIFF?=
+
+ZONES= le-fay.org \
+ le-fay.org.uk \
+ le-fay.dn42 \
+ rt.uk.eu.org \
+ b.6.0.b.3.8.a.0.b.5.d.f.ip6.arpa \
+ e.1.0.0.0.8.c.1.6.0.a.2.ip6.arpa \
+ b.6.0.0.8.9.0.1.0.0.a.2.ip6.arpa \
+ a.4.0.4.8.a.b.0.1.0.0.2.ip6.arpa \
+ 5.1.0.4.8.a.b.0.1.0.0.2.ip6.arpa \
+ 5.b.a.a.0.b.8.0.1.0.0.2.ip6.arpa \
+ 117.73.187.81.in-addr.arpa \
+ 160-175.96.2.81.in-addr.arpa \
+ 192-207.47.187.81.in-addr.arpa \
+ 0/26.76.23.172.in-addr.arpa \
+ 18.198.in-addr.arpa
+
+all:
+ @echo "Please specify a target:"
+ @echo " make diff show diff between zone files and online zone"
+ @echo " make update-zones update online zones"
+
+.PATH: zones
+.PHONY: all update-zones
+
+.for zone in ${ZONES}
+update-zones: ${zone}
+
+.PHONY: ${zone}
+
+${zone}: ${zone:S,/,_,g}.zone
+.if ${DIFF} != ""
+ @tmpfile="$$(mktemp dns.XXXXXX)"; \
+ ${NSDIFF} ${NSDIFFFLAGS} ${zone} $> \
+ >"$$tmpfile" 2>&1 \
+ || cat "$$tmpfile"; \
+ rm "$$tmpfile"
+.else
+ ${NSDIFF} ${NSDIFFFLAGS} ${zone} $> | nsupdate -g
+.endif
+.endfor
+
+.PHONY: diff
+
+diff:
+ @${MAKE} update-zones DIFF=yes