wiki:running_certbot_hook_scripts
Table of Contents
Running certbot hook scripts
Make sure you set the SHELL and PATH variables in crontab:
- download
SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ...
Then in the /etc/letsencrypt/renewal-hooks/deploy directory put your script which will be automatically executed next time when the certificates are renewed.
Example script:
- download
#!/bin/bash servers=("apache2" "httpd" "nginx") for server in "${servers[@]}"; do if command -v "$server" &> /dev/null; then systemctl restart "$server" fi done
Make sure the script is executable
Tested on
- certbot version: 4.0.0
- AlmaLinux 9.4 (Seafoam Ocelot)
See also
References
wiki/running_certbot_hook_scripts.txt · Last modified: by antisa
