Skip to content

Instantly share code, notes, and snippets.

@moritzheiber
Created March 6, 2016 14:31
Show Gist options
  • Select an option

  • Save moritzheiber/3590959b1032ed5f40df to your computer and use it in GitHub Desktop.

Select an option

Save moritzheiber/3590959b1032ed5f40df to your computer and use it in GitHub Desktop.
Renew domains with Let's Encrypt
#!/bin/bash
set -xeu
declare -a DOMAINS
DOMAINS=(enter your domains here) # separated by spaces
DIR="/tmp/letsencrypt-auto"
LETSENCRYPT="/home/moe/letsencrypt"
URL="https://acme-v01.api.letsencrypt.org/directory"
STAGING_URL="https://acme-staging.api.letsencrypt.org/directory"
EMAIL="your@email.here"
if [ "${1}" == "--test" ] ; then
URL="${STAGING_URL}"
fi
mkdir -p "${DIR}" &&
for domain in "${DOMAINS[@]}" ; do
"${LETSENCRYPT}"/letsencrypt-auto certonly \
--server "${URL}" \
-a webroot \
--webroot-path="${DIR}" \
--strict-permissions \
--agree-tos \
--text \
--keep \
--email "${EMAIL}" \
-d ${domain}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment