From 36bec899cd9190b0965174fc9edcf183f13d6114 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 14 Jun 2022 11:14:39 +0200 Subject: Handling comments in TSIG keyfiles in dehydrated-nsupdate to support disabling TSIG for individual records. Signed-off-by: Daniel Baumann --- dehydrated/bin/dehydrated-nsupdate | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dehydrated/bin/dehydrated-nsupdate') 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 -- cgit v1.2.3