mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-01 01:02:45 +00:00
Fix retrieval of domain zone
This commit is contained in:
parent
13c7182948
commit
63fca33b04
@ -140,14 +140,13 @@ _dns() {
|
|||||||
# Gets the root domain zone for given domain.
|
# Gets the root domain zone for given domain.
|
||||||
# Usage: _get_zone _acme-challenge.www.example.com
|
# Usage: _get_zone _acme-challenge.www.example.com
|
||||||
_get_zone() {
|
_get_zone() {
|
||||||
_info 'Getting domain zone...'
|
|
||||||
_debug2 'Initial FQDN' "$1"
|
|
||||||
fqdn="$1"
|
fqdn="$1"
|
||||||
fqdn="${fqdn#*.}" # Strip "_acme-challenge" right away
|
domains="$(_get "$AF_URL_DOMAINS" "" 10)"
|
||||||
_debug2 'Reduced FQDN' "$fqdn"
|
_info 'Getting domain zone...'
|
||||||
|
_debug2 'FQDN' "$fqdn"
|
||||||
|
_debug2 'Domains' "$domains"
|
||||||
|
|
||||||
domains="$(_get "$AF_URL_DOMAINS" '' 10)"
|
while _contains "$fqdn" "."; do
|
||||||
while true; do
|
|
||||||
if _contains "$domains" "$fqdn"; then
|
if _contains "$domains" "$fqdn"; then
|
||||||
domain="$fqdn"
|
domain="$fqdn"
|
||||||
_info "Found root domain zone: $domain"
|
_info "Found root domain zone: $domain"
|
||||||
@ -162,7 +161,7 @@ _get_zone() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_err "Couldn't find root domain zone."
|
_err 'Couldn\'t find root domain zone.'
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user