Skip to content

Instantly share code, notes, and snippets.

@Sen
Last active April 7, 2023 08:02
Show Gist options
  • Save Sen/4b6b45e14cfcf7aebdbba341133b0ca1 to your computer and use it in GitHub Desktop.
Save Sen/4b6b45e14cfcf7aebdbba341133b0ca1 to your computer and use it in GitHub Desktop.
naive restart after Certbot cert updated
# /lib/systemd/system/certbot.service
[Unit]
Description=Certbot
Documentation=file:///usr/share/doc/python-certbot-doc/html/index.html
Documentation=https://letsencrypt.readthedocs.io/en/latest/
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot -q renew --post-hook "kill -9 $(ps -aef | grep "caddy" | grep -v grep | awk '{ print $2 }')"
PrivateTmp=true
TZ=Asia/Shanghai
0 5 * * 1 certbot renew --post-hook "kill -9 $(ps -aef | grep "caddy" | grep -v grep | awk '{ print $2 }')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment