Added configurable wait period.

This commit is contained in:
Erik C. Thauvin 2020-03-03 18:48:47 -08:00
parent 94aa40f848
commit 97c2f0581f
4 changed files with 17 additions and 7 deletions

View file

@ -44,5 +44,5 @@ certbot certonly --manual --email you@example.com \
</pre>
Please note that NameSilo DNS propagation takes up to **15 minutes**,
so the scripts will wait 16 minutes before completing.
so the scripts will wait 20 minutes before completing.

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python3.7
#!/usr/bin/env python3.8
# authenticator.py
#
# Copyright (c) 2019, Erik C. Thauvin (erik@thauvin.net)
# Copyright (c) 2019-20, Erik C. Thauvin (erik@thauvin.net)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -39,7 +39,15 @@ import urllib.request
import untangle
from config import apikey
from config import apikey, wait
def sleep(minutes):
if minutes < 16:
minutes = 16
print("Waiting", minutes, "minutes for DNS changes to complete...")
time.sleep(minutes * 60)
domain = os.environ['CERTBOT_DOMAIN']
validation = os.environ['CERTBOT_VALIDATION']
@ -79,5 +87,5 @@ else:
xml.namesilo.reply.code.cdata), file=sys.stderr)
sys.exit(1)
# Sleep 16 minutes
time.sleep(960)
# Sleep X minutes
sleep(wait)

View file

@ -2,7 +2,7 @@
# cleanup.py
#
# Copyright (c) 2019, Erik C. Thauvin (erik@thauvin.net)
# Copyright (c) 2019-20, Erik C. Thauvin (erik@thauvin.net)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View file

@ -1,2 +1,4 @@
# Get your API Key from: https://www.namesilo.com/account_api.php
apikey = "YOUR_API_KEY"
# Minutes to wait for DNS changes to complete.
wait = 20