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
|
## 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
|
#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]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
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"
|
echo "$dst is not writable. Download to /tmp instead"
|
||||||
dst=/tmp
|
dst=/tmp
|
||||||
fi
|
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
|
cat <<EOF
|
||||||
|
|
||||||
|
|
||||||
Next step:
|
Next step:
|
||||||
(1) edit $dst/certrenew.service
|
(1) Edit $dst/certrenew.service
|
||||||
(2) $ sudo systemctl enable certrenew.service certrenew.timer certrenew.path
|
(2) Run the following commands:
|
||||||
(3) $ sudo systemctl start certrenew.service certrenew.timer certrenew.target certrenew.path
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable certrenew.service
|
||||||
|
sudo systemctl start certrenew.service certrenew.timer
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -z "$EDITOR" ]; then
|
if [ -z "$EDITOR" ]; then
|
||||||
|
|
Loading…
Reference in a new issue