summaryrefslogtreecommitdiffstats
path: root/dehydrated/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-14 09:14:39 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-14 11:59:26 +0000
commit36bec899cd9190b0965174fc9edcf183f13d6114 (patch)
tree255473b99ccfa5e5a08b85d2188e5dd6e6d08a6a /dehydrated/bin
parentAdding support for individual TSIG files per record, zone, and nameserver rat... (diff)
downloadservice-tools-36bec899cd9190b0965174fc9edcf183f13d6114.tar.xz
service-tools-36bec899cd9190b0965174fc9edcf183f13d6114.zip
Handling comments in TSIG keyfiles in dehydrated-nsupdate to support disabling TSIG for individual records.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'dehydrated/bin')
-rwxr-xr-xdehydrated/bin/dehydrated-nsupdate5
1 files changed, 4 insertions, 1 deletions
diff --git a/dehydrated/bin/dehydrated-nsupdate b/dehydrated/bin/dehydrated-nsupdate
index 5bb253a..05027ab 100755
--- a/dehydrated/bin/dehydrated-nsupdate
+++ b/dehydrated/bin/dehydrated-nsupdate
@@ -163,7 +163,10 @@ do
KEY=""
fi
- if [ -n "${KEY}" ]
+ # ignoring comments to allow empty keyfiles to disable TSIG individually
+ TSIG="$(grep -sv '^#' "${KEY}" || true)"
+
+ if [ -n "${KEY}" ] && [ -n "${TSIG}" ]
then
NSUPDATE_OPTIONS="-k ${KEY}"
fi