From: Ralf Jung Date: Fri, 20 Mar 2026 10:38:58 +0000 (+0100) Subject: only attempt unstaging if both key and cert exist X-Git-Url: https://git.ralfj.de/lets-encrypt-tiny.git/commitdiff_plain/d066d602c00de6bf86ad5299399fda026dff8bb5?hp=53d17049bb85096d7f640ca1c8960f3dc6362fc9 only attempt unstaging if both key and cert exist --- diff --git a/letsencrypt-tiny b/letsencrypt-tiny index eef52e7..902639b 100755 --- a/letsencrypt-tiny +++ b/letsencrypt-tiny @@ -101,9 +101,9 @@ def generate_key(name): def check_staging(live, staging): '''Returns 0 if nothing was done, 1 if a stage key is present but has to be kept, 2 is a stage key was unstaged.''' - if not os.path.exists(keyfile(staging)): + if not (os.path.exists(keyfile(staging)) and os.path.exists(certfile(staging))): return 0 - + staging_time = datetime.timedelta(hours = int(config['timing'].get('staging-hours', 0))) key_age = datetime.datetime.now() - key_mtime(staging) if key_age < staging_time: