aboutsummaryrefslogtreecommitdiffstats
path: root/21-pdnsd
blob: c9a79445d461373809529ff09c3822392c73605e (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
#!/bin/sh

if pdnsd-ctl status >/dev/null 2>/dev/null; then
	case "${reason}" in
		BOUND|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)
			# Set the IP of "dynamic" entry for pdnsd
			SRVS=""
			for NAMESERVER in ${new_domain_name_servers}; do
				if [ -z "${SRVS}" ]; then
					SRVS="${NAMESERVER}"
				else
					SRVS="${SRVS},${NAMESERVER}"
				fi
			done
			pdnsd-ctl server dynamic up ${SRVS}
			;;
		PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP)
			# reset to values in /etc/pdnsd.conf
			pdnsd-ctl config
			;;
		INFORM)
			# do nothing here
			;;
	esac
fi