Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stepansantalov/51b6c26674cc07dcba7ed239e928eea0 to your computer and use it in GitHub Desktop.
Save stepansantalov/51b6c26674cc07dcba7ed239e928eea0 to your computer and use it in GitHub Desktop.
Automatic LetsEncrypt certificate update for /etc/cron.monthly/
#!/bin/bash
temp_file="/tmp/cbrn.txt"
email=""
certbot renew > $temp_file 2>&1
mail -s "Letsencrypt certificates renewal" $email < $temp_file
rm $temp_file
service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment