Skip to content

Instantly share code, notes, and snippets.

@seeschloss
Created December 17, 2015 15:35
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 seeschloss/809c03b1139fbd92e839 to your computer and use it in GitHub Desktop.
Save seeschloss/809c03b1139fbd92e839 to your computer and use it in GitHub Desktop.
#!/bin/bash
DOMAINS="example.com www.example.com example.fr"
EMAIL="admin@example.com"
SCRIPT=$(realpath "$0")
DIR=$(dirname "$SCRIPT")
CERTS="$DIR/certs"
WWW="$DIR/www"
LE_CERTS="$CERTS/letsencrypt"
mkdir -p "$LE_CERTS"
DOMAINS_ARG=""
for DOMAIN in $DOMAINS; do
DOMAINS_ARG="${DOMAINS_ARG} -d ${DOMAIN}"
done
letsencrypt certonly -t --agree-tos --renew-by-default --email "$EMAIL" --webroot -w "$WWW" $DOMAINS_ARG --logs-dir "$LE_CERTS" --work-dir "$LE_CERTS" --config-dir "$LE_CERTS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment