mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 21:29:29 +02:00
correct order of processes
This commit is contained in:
parent
a66719a905
commit
9791d06dff
@ -128,19 +128,6 @@ def subscriptionsNew(ip, dnsservice, id, token, target):
|
||||
if dnsservice == "duckdns":
|
||||
duckDNSupdate(getsubdomain(id), token, realip)
|
||||
|
||||
# run the ACME script
|
||||
print("# Running letsencrypt ACME script ...")
|
||||
acmeResult = subprocess.Popen(
|
||||
["/home/admin/config.scripts/bonus.letsencrypt.sh", "issue-cert", dnsservice, id, token, target],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf8')
|
||||
out, err = acmeResult.communicate()
|
||||
eprint(str(out))
|
||||
eprint(str(err))
|
||||
if out.find("error=") > -1:
|
||||
time.sleep(6)
|
||||
raise BlitzError("letsancrypt acme failed", out)
|
||||
|
||||
|
||||
# create subscription data for storage
|
||||
subscription = dict()
|
||||
subscription['type'] = "letsencrypt-v1"
|
||||
@ -175,6 +162,18 @@ def subscriptionsNew(ip, dnsservice, id, token, target):
|
||||
eprint(e)
|
||||
raise BlitzError("fail on subscription storage", str(subscription), e)
|
||||
|
||||
# run the ACME script
|
||||
print("# Running letsencrypt ACME script ...")
|
||||
acmeResult = subprocess.Popen(
|
||||
["/home/admin/config.scripts/bonus.letsencrypt.sh", "issue-cert", dnsservice, id, token, target],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf8')
|
||||
out, err = acmeResult.communicate()
|
||||
eprint(str(out))
|
||||
eprint(str(err))
|
||||
if out.find("error=") > -1:
|
||||
time.sleep(6)
|
||||
raise BlitzError("letsancrypt acme failed", out)
|
||||
|
||||
print("# OK - LETSENCRYPT DOMAIN IS READY")
|
||||
return subscription
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user