X-Git-Url: https://git.ralfj.de/zonemaker.git/blobdiff_plain/684fde7097441fab5cdb52265cfc8a43675af476..a07f8b89239fb177a995ebda24fcdc71616c35af:/Makefile.sample?ds=inline diff --git a/Makefile.sample b/Makefile.sample index 3af6904..a78edf3 100644 --- a/Makefile.sample +++ b/Makefile.sample @@ -1,7 +1,18 @@ -all: db.example.com +# edit list of zones and other configuration here +zones := example.com +user := user +zonemaker := ~user/zonemaker/zonemaker -db.example.com: db.example.com.py - @sudo -u user ~user/zonemaker/zone-maker $< > $@ || rm -f $@ +# heres comes the magic +zonefiles = $(addprefix db.,${zones}) +all: ${zonefiles} +.PHONY: all + +db.%: db.%.py + @echo $* $< $@ + @sudo -u ${user} ${zonemaker} $< > $@ || rm -f $@ @cat $@ @echo - @rndc reload example.com || rm -f $@ + @rndc reload $* # this only returns errors if the zone had not previously been loaded :-/ + @sleep 1 + @fgrep 'zone '$*'/IN' /var/log/syslog | tail -n 5