Merge pull request #100 from inkblot/rndc-helper

Implement a helper script for zone reloads
This commit is contained in:
Nate Riffe
2016-07-09 09:09:44 -05:00
committed by GitHub
6 changed files with 50 additions and 13 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
CONFDIR=<%= @confdir %>
function param_lookup() {
local zone_name="${1}"
local domain="$(grep "^${zone_name}:" ${CONFDIR}/domain-mappings.txt | cut -f2 -d:)"
grep "^${zone_name}:" ${CONFDIR}/view-mappings.txt | cut -f2 -d: | sed -e "s/\(.*\)/${domain} IN \1/"
}
zone_name="${!#}"
param_lookup "${zone_name}" | while read Z; do
if [ $# == 1 ]; then
echo $Z
else
/usr/sbin/rndc "${@:1:$(($# - 1))}" $Z
fi
done
+3
View File
@@ -0,0 +1,3 @@
<%- @zones.each do |zone| -%>
<%= zone %>:<%= @name %>
<%- end -%>