From b3df1a2bf83bcbea3106547c75ae3d84c9895225 Mon Sep 17 00:00:00 2001 From: Shane Bishop Date: Wed, 7 Sep 2022 13:42:30 -0600 Subject: [PATCH 1/2] 'i' should start with 1 Since domain alias mode won't have the '_acme-challenge' prefix. --- dnsapi/dns_dgon.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dnsapi/dns_dgon.sh b/dnsapi/dns_dgon.sh index ac14da48..259f4d39 100755 --- a/dnsapi/dns_dgon.sh +++ b/dnsapi/dns_dgon.sh @@ -205,9 +205,7 @@ _get_base_domain() { fi _debug2 domain_list "$domain_list" - ## for each shortening of our $fulldomain, check if it exists in the $domain_list - ## can never start on 1 (aka whole $fulldomain) as $fulldomain starts with "_acme-challenge" - i=2 + i=1 while [ $i -gt 0 ]; do ## get next longest domain _domain=$(printf "%s" "$fulldomain" | cut -d . -f "$i"-"$MAX_DOM") From dcc9624c15e32cb5d9d90cf381c7789d9242b7d1 Mon Sep 17 00:00:00 2001 From: Shane Bishop Date: Wed, 7 Sep 2022 15:37:49 -0600 Subject: [PATCH 2/2] Update dns_dgon.sh Make sure to initialize 'found' so that it isn't contaminated from previous commands/requests. --- dnsapi/dns_dgon.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dnsapi/dns_dgon.sh b/dnsapi/dns_dgon.sh index 259f4d39..afe1b32e 100755 --- a/dnsapi/dns_dgon.sh +++ b/dnsapi/dns_dgon.sh @@ -192,6 +192,7 @@ _get_base_domain() { ## get URL for the list of domains ## may get: "links":{"pages":{"last":".../v2/domains/DOM/records?page=2","next":".../v2/domains/DOM/records?page=2"}} DOMURL="https://api.digitalocean.com/v2/domains" + found="" ## while we dont have a matching domain we keep going while [ -z "$found" ]; do