diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | named.sh | 27 |
2 files changed, 28 insertions, 0 deletions
@@ -5,6 +5,7 @@ HOOKDIR?= ${DESTDIR}${PREFIX}/share/lfldap/hooks HOOKS= apache24.sh \ chrony.sh \ + named.sh \ nginx.sh \ pf.sh \ postfix.sh diff --git a/named.sh b/named.sh new file mode 100644 index 0000000..8c2ebaa --- /dev/null +++ b/named.sh @@ -0,0 +1,27 @@ +# This source code is released into the public domain. +# +# The named allow_internal.conf file is an ACL definition containing a +# list of "<prefix>;" + +NAMED_FILE="/usr/local/etc/namedb/allow_internal.conf" +NAMED_TEMP="${NAMED_FILE}.ldaptmp" + +if [ ! -f "$NAMED_FILE" ]; then + exit 0 +fi + +printf >"$NAMED_TEMP" 'acl "allow_internal" {\n' +awk <"$NETWORKS_FILE" >>"$NAMED_TEMP" '{ print $1 ";" }' +printf >>"$NAMED_TEMP" '};\n' + +if cmp -s "$NAMED_TEMP" "$NAMED_FILE"; then + rm "$NAMED_TEMP" + exit 0 +fi + +printf '%s updated:\n\n' "$NAMED_FILE" +diff "$NAMED_FILE" "$NAMED_TEMP" +printf '\n' + +mv "$NAMED_TEMP" "$NAMED_FILE" +/usr/local/sbin/rndc reload |
