fix cleanup script too

This commit is contained in:
Fredrik Eriksson 2021-06-18 20:24:21 +02:00
parent 8053908cff
commit 3311e2099a
Signed by: feffe
GPG Key ID: F4329687B0FA7F8D

View File

@ -56,12 +56,14 @@ def main():
else: else:
client = xmlrpc.client.ServerProxy(uri = url, encoding='utf-8') client = xmlrpc.client.ServerProxy(uri = url, encoding='utf-8')
parts=[]
while domain: while domain:
res = client.getSubdomains(user, pwd, domain) res = client.getSubdomains(user, pwd, domain)
if 'UNKNOWN_ERROR' not in res: if 'UNKNOWN_ERROR' not in res:
break break
subdomain, domain = domain.split('.', maxsplit=1) part, domain = domain.split('.', maxsplit=1)
subdomain = '_acme-challenge.{}'.format(subdomain) parts.append(part)
subdomain = '_acme-challenge.{}'.format('.'.join(parts))
if 'UNKNOWN_ERROR' in res: if 'UNKNOWN_ERROR' in res:
print("Failed to find domain in loopiadns") print("Failed to find domain in loopiadns")