summaryrefslogtreecommitdiffstats
path: root/dehydrated/bin/dehydrated-nsupdate
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 05:24:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 05:24:37 +0000
commita2d154a429d225e29038ceef6ae4022854096c2e (patch)
tree1c01675a68f3040bb7f1df61e9c57479483effe8 /dehydrated/bin/dehydrated-nsupdate
parentReleasing debian version 20210905-1. (diff)
downloadopen-infrastructure-service-tools-a2d154a429d225e29038ceef6ae4022854096c2e.tar.xz
open-infrastructure-service-tools-a2d154a429d225e29038ceef6ae4022854096c2e.zip
Merging upstream version 20210906.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dehydrated/bin/dehydrated-nsupdate')
-rwxr-xr-xdehydrated/bin/dehydrated-nsupdate7
1 files changed, 3 insertions, 4 deletions
diff --git a/dehydrated/bin/dehydrated-nsupdate b/dehydrated/bin/dehydrated-nsupdate
index 7b6ea34..b870e3b 100755
--- a/dehydrated/bin/dehydrated-nsupdate
+++ b/dehydrated/bin/dehydrated-nsupdate
@@ -79,7 +79,7 @@ do
done
# find txt record to update
-CNAME="$(${DIG} "_acme-challenge.${DOMAIN}" 2>&1 | awk '/CNAME/ { print $5 }' | tail -n1)"
+CNAME="$(${DIG} +nocomments +noquestion "_acme-challenge.${DOMAIN}" 2>&1 | grep -v '^;' | awk '/CNAME/ { print $5 }' | tail -n1)"
if [ -n "${CNAME}" ]
then
@@ -93,10 +93,11 @@ ZONE="${TXT_RECORD}"
while true
do
- NAMESERVERS="$(${DIG} NS "${ZONE}" 2>&1 | awk '/NS/ { print $5 }' | tail -n1)"
+ NAMESERVERS="$(${DIG} +nocomments +noquestion NS "${ZONE}" 2>&1 | grep -v '^;' | awk '/NS/ { print $5 }')"
if [ -n "${NAMESERVERS}" ]
then
+ ZONE="$(${DIG} +nocomments +noquestion NS "${ZONE}" 2>&1 | grep -v '^;' | awk '/NS/ { print $1 }' | tail -n1)"
break
else
ZONE="$(echo "${ZONE}" | cut -d '.' -f 2-)"
@@ -108,8 +109,6 @@ then
NSUPDATE_OPTIONS="-k ${TSIG_KEYFILE}"
fi
-NAMESERVERS="$(${DIG} +short NS "${ZONE}")"
-
# update nameservers
for NAMESERVER in ${NAMESERVERS}
do