summaryrefslogtreecommitdiffstats
path: root/dehydrated/bin/dehydrated-nsupdate
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-05 07:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-05 07:14:46 +0000
commitc1338b131aa7a1a44fd0aea8c02951f14178af97 (patch)
tree1015777a220286b97471abe25b9b6becb181aad2 /dehydrated/bin/dehydrated-nsupdate
parentReleasing debian version 20210904-1. (diff)
downloadopen-infrastructure-service-tools-c1338b131aa7a1a44fd0aea8c02951f14178af97.tar.xz
open-infrastructure-service-tools-c1338b131aa7a1a44fd0aea8c02951f14178af97.zip
Merging upstream version 20210905.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dehydrated/bin/dehydrated-nsupdate')
-rwxr-xr-xdehydrated/bin/dehydrated-nsupdate8
1 files changed, 7 insertions, 1 deletions
diff --git a/dehydrated/bin/dehydrated-nsupdate b/dehydrated/bin/dehydrated-nsupdate
index ec8cf7f..7b6ea34 100755
--- a/dehydrated/bin/dehydrated-nsupdate
+++ b/dehydrated/bin/dehydrated-nsupdate
@@ -103,6 +103,11 @@ do
fi
done
+if [ -n "${TSIG_KEYFILE}" ] && [ -e "${TSIG_KEYFILE}" ]
+then
+ NSUPDATE_OPTIONS="-k ${TSIG_KEYFILE}"
+fi
+
NAMESERVERS="$(${DIG} +short NS "${ZONE}")"
# update nameservers
@@ -110,11 +115,12 @@ for NAMESERVER in ${NAMESERVERS}
do
echo -n " + sending '${HOOK_ACTION}' for ${TXT_RECORD} to ${NAMESERVER}..."
+# shellcheck disable=SC2086
echo "server ${NAMESERVER}
zone ${ZONE}
ttl 0
update ${HOOK_ACTION} ${TXT_RECORD} 0 TXT ${TOKEN_VALUE}
-send" | "${NSUPDATE}"
+send" | "${NSUPDATE}" ${NSUPDATE_OPTIONS}
echo " done."
done