Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.