Move reload hook to certrenew.service
This commit is contained in:
parent
a9ddf5a2b6
commit
e4d7c55e0a
5 changed files with 9 additions and 18 deletions
|
@ -1,8 +0,0 @@
|
|||
[Unit]
|
||||
Description=Restart services which use SSL when the cert directory changes
|
||||
|
||||
[Path]
|
||||
PathChanged=/etc/letsencrypt/live
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -15,5 +15,8 @@ Type=simple
|
|||
## porkbun
|
||||
#ExecStart=/usr/bin/certbot renew --non-interactive --agree-tos --preferred-challenges dns --authenticator dns-porkbun --dns-porkbun-credentials /etc/certbot/porkbun.ini --dns-porkbun-propagation-seconds 10
|
||||
|
||||
## Reload the following services after renewing certs
|
||||
ExecStopPost=/bin/systemctl reload nginx postfix dovecot
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[Unit]
|
||||
Description=Services which need reloaded with SSL certs are updated
|
||||
PropagatesReloadTo=nginx postfix dovecot
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
sudo systemctl enable certrenew.service certrenew.timer certrenew.path
|
||||
sudo systemctl start certrenew.service certrenew.timer certrenew.target certrenew.path
|
10
setup.sh
10
setup.sh
|
@ -5,14 +5,16 @@ if [ ! -w "$dst" ]; then
|
|||
echo "$dst is not writable. Download to /tmp instead"
|
||||
dst=/tmp
|
||||
fi
|
||||
wget -P "$dst" "$baseURL/certrenew.service" "$baseURL/certrenew.timer" "$baseURL/certrenew.target" "$baseURL/certrenew.path"
|
||||
wget -P "$dst" "$baseURL/certrenew.service" "$baseURL/certrenew.timer"
|
||||
cat <<EOF
|
||||
|
||||
|
||||
Next step:
|
||||
(1) edit $dst/certrenew.service
|
||||
(2) $ sudo systemctl enable certrenew.service certrenew.timer certrenew.path
|
||||
(3) $ sudo systemctl start certrenew.service certrenew.timer certrenew.target certrenew.path
|
||||
(1) Edit $dst/certrenew.service
|
||||
(2) Run the following commands:
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable certrenew.service
|
||||
sudo systemctl start certrenew.service certrenew.timer
|
||||
EOF
|
||||
|
||||
if [ -z "$EDITOR" ]; then
|
||||
|
|
Loading…
Reference in a new issue