mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-22 13:11:41 +00:00
dns_duckdns.sh - correctly extract domain
$fulldomain could be just 'domain.duckdns.org' if provided with --domain-alias or '_acme-challenge.domain.duckdns.org' otherwise. In the latter case, '_acme-challenge' is thrown away. Correctly extract 'domain' in both cases.
This commit is contained in:
parent
8718ac0c4b
commit
4539d236df
@ -91,13 +91,12 @@ dns_duckdns_rm() {
|
|||||||
|
|
||||||
#################### Private functions below ##################################
|
#################### Private functions below ##################################
|
||||||
|
|
||||||
#fulldomain=acme-challenge-domain.duckdns.org
|
# fulldomain may be 'domain.duckdns.org' (if using --domain-alias) or '_acme-challenge.domain.duckdns.org'
|
||||||
#returns
|
# either way, return 'domain'. (duckdns does not allow further subdomains and restricts domains to [a-z0-9-].)
|
||||||
# _duckdns_domain=acme-challenge-domain
|
|
||||||
_duckdns_get_domain() {
|
_duckdns_get_domain() {
|
||||||
|
|
||||||
# We'll extract the domain/username from full domain
|
# We'll extract the domain/username from full domain
|
||||||
_duckdns_domain="$(printf "%s" "$fulldomain" | _lower_case | sed 's/^\([a-z0-9-]*\)\.duckdns\.org/\1/')"
|
_duckdns_domain="$(printf "%s" "$fulldomain" | _lower_case | _egrep_o '^(_acme-challenge\.)?[a-z0-9-]*\.duckdns\.org' | sed -E 's/^(_acme-challenge\.)?([a-z0-9-]*)\.duckdns\.org/\2/')"
|
||||||
|
|
||||||
if [ -z "$_duckdns_domain" ]; then
|
if [ -z "$_duckdns_domain" ]; then
|
||||||
_err "Error extracting the domain."
|
_err "Error extracting the domain."
|
||||||
|
Loading…
Reference in New Issue
Block a user