aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.inc.unbound
blob: db6f1fbc668f8253a306c5ee4c3111caa1e370ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This source code is released into the public domain.

# Unbound configuration files.

UNBOUND_CONF_DIR?=/usr/local/etc/unbound
UNBOUND_CONF_FILE?=${UNBOUND_CONF_DIR}/unbound.conf
UNBOUND_PROCESS_FLAGS?= \
	-Dconfdir=/usr/local/etc/unbound \
	-Dmaster="${MASTER}" \
	-Dmaster_addr="${MASTER_ADDR}" \
	-Dlocal_zones="${ZONES}" \
	-Dinsecure_zones="${INSECURE_ZONES}" \
	-Ddn42_zones="${DN42_ZONES}" \
	-Ddn42_master="${DN42_MASTER}" \
	-Dforwarders="${UNBOUND_FORWARDERS}"

unbound:
.PHONY: unbound

.for server in ${UNBOUND_SERVERS}

unbound.conf.${server}: Makefile unbound.conf.erb
	${.CURDIR}/bin/process				\
		-Dservername=${server}			\
		${UNBOUND_PROCESS_FLAGS}		\
		${UNBOUND_PROCESS_FLAGS.${server}}	\
		${.CURDIR}/unbound.conf.erb $@

unbound: unbound-${server}
unbound-${server}: unbound.conf.${server}
	@echo ""
	@echo "===> updating ${server}"
	@echo ""
	scp -q $> root@${server}:${UNBOUND_CONF_FILE}
	ssh root@${server} service unbound restart

.PHONY: unbound-${server}

clean: clean-unbound-${server}
clean-unbound-${server}:
	rm -f ${.OBJDIR}/unbound.conf.${server}
.PHONY: clean-unbound-${server}

.endfor