diff options
Diffstat (limited to 'dehydrated')
-rwxr-xr-x | dehydrated/bin/dehydrated-nsupdate | 7 |
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 |