diff --git a/README.md b/README.md index 33b8c7f..2df0e23 100644 --- a/README.md +++ b/README.md @@ -73,18 +73,22 @@ mail.example.com: group: postfix perm: '400' format: key - action: '/etc/init.d/postfix reload' + actions: + - '/etc/init.d/postfix reload' + - '/trigger/some/script' - path: /etc/postfix/ssl/mail.crt user: postfix group: postfix perm: '400' format: crt - action: '/etc/init.d/postfix reload' + actions: + - '/etc/init.d/postfix reload' - path: /etc/dovecot/ssl/mail.crt user: dovecot group: dovecot perm: '400' - action: '/etc/init.d/dovecot reload' + actions: + - '/etc/init.d/dovecot reload' jabber.example.com: - path: /etc/ejabberd/server.pem @@ -92,20 +96,23 @@ jabber.example.com: group: jabber perm: '400' format: key,crt,ca - action: '/etc/init.d/ejabberd restart' + actions: + - '/etc/init.d/ejabberd restart' www.example.com example.com: - path: /var/www/ssl/cert.pem user: apache group: apache perm: '400' - action: '/etc/init.d/apache2 reload' + actions: + - '/etc/init.d/apache2 reload' format: crt,ca - path: /var/www/ssl/key.pem user: apache group: apache perm: '400' - action: '/etc/init.d/apache2 reload' + action: + - '/etc/init.d/apache2 reload' format: key ``` diff --git a/acertmgr.py b/acertmgr.py index 4343f2e..c1787ed 100755 --- a/acertmgr.py +++ b/acertmgr.py @@ -130,7 +130,7 @@ def cert_put(domain, settings): crt_perm = settings['perm'] crt_path = settings['path'] crt_format = settings['format'].split(",") - crt_action = settings['action'] + crt_actions = settings['actions'] key_file = settings['server_key'] crt_final = os.path.join(ACME_DIR, ("%s.crt" % domain.split(' ')[0])) @@ -167,7 +167,7 @@ def cert_put(domain, settings): except OSError: print('Warning: Could not set certificate file permissions!') - return crt_action + return set(crt_actions) # @brief augment configuration with defaults @@ -222,7 +222,7 @@ if __name__ == "__main__": for domaincfg in domaincfgs: cfg = complete_config(domaincfg, config) if not target_isCurrent(cfg['path'], crt_file): - actions.add(cert_put(domains, cfg)) + actions = actions | cert_put(domains, cfg) # run post-update actions for action in actions: