-
Notifications
You must be signed in to change notification settings - Fork 4
/
certbot-renew-hook.sh
33 lines (26 loc) · 970 Bytes
/
certbot-renew-hook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# certbot renew-hook script
#
# Syntax:
# certbot renew --renew-hook [path/]certbot-renewal-hook.sh
#
# This file is intended to contain the commands you want to be executed
# after a renewal of any of the certificates configured in your system.
#
# You may comment out and adjust one or more of these examples or insert
# your own commands.
## adapt this to your needs
MYDOMAIN=subdom.example.com
## copy cert files to a place where e.g. apache will need them
# cd /etc/letsencrypt/live/$MYDOMAIN/
# cp -L fullchain.pem /etc/ssl/certs/$MYDOMAIN.pem
# cp -L privkey.pem /etc/ssl/private/$MYDOMAIN.pem
## restart apache2 webserver
# systemctl restart apache2.service
## reload postfix mailserver
# systemctl reload postfix.service
## copy cert files to another host - adapt path to your (sub)domain!
## to make this work you must set up ssh key authentication
# cd /etc/letsencrypt/live/$MYDOMAIN/
# scp *.pem otherserver.example.com:/somewhere/