Skip to content

Instantly share code, notes, and snippets.

@basert
Created December 30, 2015 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basert/0a846b4f0e4e78936b56 to your computer and use it in GitHub Desktop.
Save basert/0a846b4f0e4e78936b56 to your computer and use it in GitHub Desktop.
LETSENCRYPT_PATH=$HOME/letsencrypt
TMP_PATH="/tmp/letsencrypt-auto"
DOMAINS=(
"-d example.com -d www.example.com"
)
# create webroot dir
mkdir -p $TMP_PATH
# pull the latest version for letsencrypt repo
(cd $LETSENCRYPT_PATH && git pull)
echo "STARTING REQUESTS OF NEW CERTS"
for d in "${DOMAINS[@]}"
do
echo "$LETSENCRYPT_PATH/letsencrypt-auto certonly --renew-by-default --agree-tos --rsa-key-size 4096 --webroot -w $TMP_PATH $d"
$LETSENCRYPT_PATH/letsencrypt-auto certonly --renew-by-default --agree-tos --rsa-key-size 4096 --webroot -w $TMP_PATH $d
done
echo "RELOADING NGINX SERVER"
/usr/sbin/nginx -s reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment