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

See also

References