projects
/
zonemaker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
684fde7
)
more make magic
author
Ralf Jung
<post@ralfj.de>
Thu, 1 Jan 2015 13:57:26 +0000
(14:57 +0100)
committer
Ralf Jung
<post@ralfj.de>
Thu, 1 Jan 2015 13:57:26 +0000
(14:57 +0100)
Makefile.sample
patch
|
blob
|
history
README.rst
patch
|
blob
|
history
diff --git
a/Makefile.sample
b/Makefile.sample
index 3af6904f03b5883cb5de24e82226991a2c1bf5da..a78edf3d28ee05fadda46e9c8ca92128c388cb75 100644
(file)
--- 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
@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
diff --git
a/README.rst
b/README.rst
index 86fc359339ed8e774139e06a053259c7a5c88dea..feef6f010d7628f8675d2b6f8b82667c323ad841 100644
(file)
--- a/
README.rst
+++ b/
README.rst
@@
-23,7
+23,7
@@
Usage
Simply call ``zonemaker`` with the zone python file as argument. The result will
be printed to stdout. See ``db.example.com.py`` for a sample file demonstrating
the use of the interface. ``Makefile.sample`` shows how a makefile which first
Simply call ``zonemaker`` with the zone python file as argument. The result will
be printed to stdout. See ``db.example.com.py`` for a sample file demonstrating
the use of the interface. ``Makefile.sample`` shows how a makefile which first
-updates the zone, and then tells BIND to reload, could look like.
+updates the zone
(s)
, and then tells BIND to reload, could look like.
Source, License
---------------
Source, License
---------------