Last active
February 27, 2016 14:52
-
-
Save chrisjung-dev/8b649b158f7c993d9745 to your computer and use it in GitHub Desktop.
Uberspace Let's Encrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOMAIN=$(ls ~/.config/letsencrypt/live/ | head -n 1) | |
uberspace-add-certificate -k ~/.config/letsencrypt/live/${DOMAIN}/privkey.pem -c ~/.config/letsencrypt/live/${DOMAIN}/cert.pem | |
cat >> ${HOME}/.config/letsencrypt/cli.ini <<__EOF__ | |
# To prevent being forced to agree manually to the terms | |
agree-dev-preview = True | |
agree-tos = True | |
__EOF__ | |
########################################## | |
cat > ${HOME}/bin/letsencrypt-renew <<__EOF__ | |
#!/bin/bash | |
PATH=$PATH | |
DOMAIN=$(ls ~/.config/letsencrypt/live/ | head -n 1) | |
# sleep for a random time so not all certificates get renewed at the same time | |
sleep $(expr $RANDOM % 600) | |
# run let's encrypt | |
letsencrypt certonly | |
# import certificate | |
uberspace-add-certificate -k ~/.config/letsencrypt/live/$DOMAIN/privkey.pem -c ~/.config/letsencrypt/live/$DOMAIN/cert.pem | |
__EOF__ | |
########################################## | |
chmod +x ${HOME}/bin/letsencrypt-renew | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment