mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-09 09:32:44 +00:00
Skip private hosted zones correctly
This fixes the cases where a private zone is a sub-domain of a public zone, e.g. foo.com (public) and vpc.foo.com (private).
This commit is contained in:
parent
b6c2fc5a69
commit
ba311aacda
@ -105,13 +105,9 @@ _get_root() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if _contains "$response" "<Name>$h.</Name>"; then
|
||||
hostedzone="$(echo "$response" | sed 's/<HostedZone>/#&/g' | tr '#' '\n' | _egrep_o "<HostedZone><Id>[^<]*<.Id><Name>$h.<.Name>.*<PrivateZone>false<.PrivateZone>.*<.HostedZone>")"
|
||||
if [ -n "$hostedzone" ]; then
|
||||
_debug hostedzone "$hostedzone"
|
||||
if [ -z "$hostedzone" ]; then
|
||||
_err "Error, can not get hostedzone."
|
||||
return 1
|
||||
fi
|
||||
_domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "<Id>.*<.Id>" | head -n 1 | _egrep_o ">.*<" | tr -d "<>")
|
||||
if [ "$_domain_id" ]; then
|
||||
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
|
||||
|
Loading…
x
Reference in New Issue
Block a user