mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-06 18:12:14 +02:00
use popen
This commit is contained in:
@@ -109,10 +109,11 @@ def subscriptionsNew(ip, dnsservice, id, token, target):
|
|||||||
duckDNSupdate(getsubdomain(id), token, realip)
|
duckDNSupdate(getsubdomain(id), token, realip)
|
||||||
|
|
||||||
# run the ACME script
|
# run the ACME script
|
||||||
acmeResult=subprocess.check_output(["/home/admin/config.scripts/bonus.letsencrypt.sh", "issue-cert", dnsservice, id, token, target])
|
acmeResult=subprocess.Popen(["/home/admin/config.scripts/bonus.letsencrypt.sh", "issue-cert", dnsservice, id, token, target], stdout=subprocess.PIPE)
|
||||||
if acmeResult != 0:
|
out, err = acmeResult.communicate()
|
||||||
time.sleep(6)
|
if out.find("error=") > -1:
|
||||||
raise BlitzError("letsancrypt acme failed", acmeResult)
|
time.sleep(6)
|
||||||
|
raise BlitzError("letsancrypt acme failed", out)
|
||||||
|
|
||||||
# create subscription data for storage
|
# create subscription data for storage
|
||||||
subscription = {}
|
subscription = {}
|
||||||
@@ -170,7 +171,7 @@ def subscriptionsCancel(id):
|
|||||||
out, err = acmeResult.communicate()
|
out, err = acmeResult.communicate()
|
||||||
if out.find("error=") > -1:
|
if out.find("error=") > -1:
|
||||||
time.sleep(6)
|
time.sleep(6)
|
||||||
raise BlitzError("letsancrypt acme failed", acmeResult)
|
raise BlitzError("letsancrypt acme failed", out)
|
||||||
|
|
||||||
# persist change
|
# persist change
|
||||||
with open(SUBSCRIPTIONS_FILE, 'w') as writer:
|
with open(SUBSCRIPTIONS_FILE, 'w') as writer:
|
||||||
|
Reference in New Issue
Block a user