DNS data
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
744 B

TEMPLATES=$(wildcard root/*/*.zone.in)
ZONES=$(addprefix stage/,$(notdir $(basename $(TEMPLATES))))
.PHONY: all clean sync push
all: $(ZONES)
push: all sync
./update.sh
clean:
@for x in $(notdir $(wildcard stage/*.zone)); do \
ls -1 root/*/$$x.in > /dev/null 2>&1 || rm -v stage/$$x; \
done
sync: data
@cd data/; git pull
data:
git clone . data
pull:
git pull --rebase
root/preprocessor.sed: root/preprocessor.sh $(wildcard root/*.in) root/servers.txt
@$< > $@
define ZONE_TEMPLATE
stage/$(2).zone: $(1) root/preprocessor.sed
@echo "$(2)"
@sed -f root/preprocessor.sed \
-e 's,@@DOMAIN@@,$(2),g' \
$$< > $$@
endef
$(foreach tpl,$(TEMPLATES),$(eval $(call ZONE_TEMPLATE,$(tpl),$(patsubst %.zone.in,%,$(notdir $(tpl))))))