1
0
mirror of https://github.com/moepman/acertmgr.git synced 2024-11-14 17:25:26 +01:00

acertmgr: always check certificate destinations for update + actions

This commit is contained in:
Kishi85 2019-03-24 17:12:36 +01:00
parent fd2134753a
commit 46efc1038c

View File

@ -168,11 +168,13 @@ def main():
ttl_days = int(config['ttl_days'])
if not tools.is_cert_valid(cert_file, ttl_days):
cert_get(config)
for cfg in config['actions']:
if not target_is_current(cfg['path'], cert_file):
actions.add(cert_put(cfg))
for cfg in config['actions']:
if not tools.target_is_current(cfg['path'], cert_file):
print("Updating '{}' due to newer certificate".format(cfg['path']))
actions.add(cert_put(cfg))
# run post-update actions
for action in actions:
if action is not None:
print("Running '{}' to trigger update for changes".format(action))
subprocess.call(action.split())