Created
March 24, 2017 16:15
-
-
Save sjourdan/3f0e52dd99df346aa9221b53bdd30720 to your computer and use it in GitHub Desktop.
le-auto.sh crontab
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
#!/usr/bin/env bash | |
# 2015/12/19 initial version | |
# 2016/05/22 bugfix non-www domains | |
LE_BIN="/home/sjourdan/letsencrypt/letsencrypt-auto" | |
EMAIL="[email protected]" | |
DOMAINS="domain1.com domain2.com" | |
function generate_common_certs(){ | |
for domain in ${DOMAINS}; do | |
${LE_BIN} --text --email ${EMAIL} --domains ${domain},www.${domain} --agree-tos --renew-by-default --webroot --webroot-path /srv/www/${domain}/htdocs/ certonly | |
done | |
} | |
function reload_https_server(){ | |
sudo service nginx reload >/dev/null 2>&1 | |
} | |
generate_common_certs | |
reload_https_server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment