_duckdns_get_domain:
Adjusted sed-command to accept wildcard-domains and sub-sub-domains. Now
- *.DOMAIN.duckdns.org
- *.sub1.sub2.DOMAIN.duckdns.org
- sub1.sub2.DOMAIN.duckdns.org
will yield DOMAIN. this includes the versions preceeded by "_acme-challenge."
Tested for quite some examples to an extend that I'm quite confident, that this should work under most circumstances. But you never know...
$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.