Skip to content
Snippets Groups Projects
Commit 7135fc77 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

fix(letsencrypt): add pre & post hooks | refs #23885

parent 3f298737
No related branches found
No related tags found
No related merge requests found
......@@ -70,4 +70,11 @@ def setup(interactive=True):
utils.log('SSL configuration file "%s" updated.' % ssl_conf)
else:
utils.log('SSL configuration file "%s" already up to date.' % ssl_conf)
utils.run_commands(['nginx -t', 'service nginx restart'])
utils.run_commands(['nginx -t', 'systemctl restart nginx'])
# add pre and post certbot hooks
dir_path = utils.get_dir(__file__)
cmds = [
'cp %s/hook_mkdir.sh /etc/letsencrypt/renewal-hooks/pre/mkdir.sh' % dir_path,
'cp %s/hook_reload.sh /etc/letsencrypt/renewal-hooks/post/reload.sh' % dir_path,
]
utils.run_commands(cmds)
#!/usr/bin/env bash
CERTBOT_DOCROOT=/tmp/letsencrypt
if [ ! -d "$CERTBOT_DOCROOT" ]; then
mkdir -p "$CERTBOT_DOCROOT"
fi
exit 0
#!/usr/bin/env bash
if nginx -t > /dev/null 2>&1; then
systemctl reload nginx
else
exit 1
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment