Skip to content

Instantly share code, notes, and snippets.

@artmouse
Created December 6, 2015 18:59
Show Gist options
  • Save artmouse/660e7f028e2389e8f94e to your computer and use it in GitHub Desktop.
Save artmouse/660e7f028e2389e8f94e to your computer and use it in GitHub Desktop.
# /etc/cron.d/ssl
5 00 */14 * * /opt/letsencrypt_yolo.sh 2>&1 | mail -s "reloading certificates" [email protected]
#!/bin/sh
if [[ $UID != 0 ]]; then
echo "please run as root"
exit 1
fi
cd /opt/letsencrypt/
git pull 2>&1 >> /dev/null
# Renewing the cert
./letsencrypt-auto certonly \
-a webroot --webroot-path /srv/letsencrypt/www \
-d jaime.les.poneys.roses.ru \
--server https://acme-v01.api.letsencrypt.org/directory \
--renew \
2>&1
/opt/letsencrypt_sync.sh
/opt/letsencrypt_reload.sh
exit 0
#!/bin/sh
/etc/init.d/nginx restart
#!/bin/sh
cp -Lv /etc/letsencrypt/live/licorn.eu/* /srv/letsencrypt/ssl/
chmod g-rwx /srv/letsencrypt/ssl/*
chmod o-rwx /srv/letsencrypt/ssl/*
touch /srv/letsencrypt/ssl/.reload_octavia
touch /srv/letsencrypt/ssl/.reload_derpy
#!/bin/sh
if [ -e /srv/letsencrypt/ssl/.reload_derpy ]; then
/etc/init.d/nginx restart
/etc/init.d/dovecot restart
/etc/init.d/opensmtpd restart
rm -vf /srv/letsencrypt/ssl/.reload_derpy
fi
# /etc/cron.d/ssl
1 00 */14 * * /opt/letsencrypt.sh 2>&1 | mail -s "certificate renewal report" [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment