From 97c2f0581f5ff8bd473dce1a9845f6ca3a0a3d2d Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 3 Mar 2020 18:48:47 -0800 Subject: [PATCH] Added configurable wait period. --- README.md | 2 +- authenticator.py | 18 +++++++++++++----- cleanup.py | 2 +- config.py | 2 ++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e878699..79d2780 100644 --- a/README.md +++ b/README.md @@ -44,5 +44,5 @@ certbot certonly --manual --email you@example.com \ 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. diff --git a/authenticator.py b/authenticator.py index 30d88e6..01fbe7a 100644 --- a/authenticator.py +++ b/authenticator.py @@ -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) diff --git a/cleanup.py b/cleanup.py index 27d38c4..eb9a289 100644 --- a/cleanup.py +++ b/cleanup.py @@ -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 diff --git a/config.py b/config.py index b30c1c3..8679450 100644 --- a/config.py +++ b/config.py @@ -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