1
0

detect zone updates + execute bind-reload-now

This commit is contained in:
Pim van den Berg 2022-06-19 19:19:48 +02:00
parent bc4110a8bb
commit 4061c8679e
2 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@ RUN set -eux; \
pdns-backend-bind \ pdns-backend-bind \
sqlite3 \ sqlite3 \
bind9-dnsutils \ bind9-dnsutils \
inotify-tools \
; \ ; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*

View File

@ -1,3 +1,11 @@
#!/bin/sh #!/bin/sh
exec /usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no /usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no &
inotifywait -mqre modify --exclude '\.git' --format '%w%f' "/var/lib/powerdns/zones/" |
while read -r path; do
zone=$(basename $path)
echo [$0] A modification was detected in $path
echo [$0] Executing \`/usr/bin/pdns_control bind-reload-now $zone\`
/usr/bin/pdns_control bind-reload-now $zone
done