Merge pull request #77 from home-assistant/build

Fix multi domains (#76)
This commit is contained in:
Pascal Vizeli
2017-05-21 23:18:34 +02:00
committed by GitHub
2 changed files with 4 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "Let's Encrypt",
"version": "0.6",
"version": "0.7",
"slug": "letsencrypt",
"description": "Manage Let's Encrypt certificate",
"url": "https://home-assistant.io/addons/lets_encrypt/",

View File

@@ -12,16 +12,13 @@ CERTFILE=$(jq --raw-output ".certfile" $CONFIG_PATH)
# Generate new certs
if [ ! -d "$CERT_DIR" ]; then
DOMAIN_ARR=()
for line in $DOMAINS; do
if [ -z "$DOMAIN_ARG" ]; then
DOMAIN_ARG="-d $line"
else
DOMAIN_ARG="$DOMAIN_ARG -d $line"
fi
DOMAIN_ARR+=(-d "$line")
done
echo "$DOMAINS" > /data/domains.gen
certbot certonly --non-interactive --standalone --email "$EMAIL" --agree-tos --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" "$DOMAIN_ARG"
certbot certonly --non-interactive --standalone --email "$EMAIL" --agree-tos --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" "${DOMAIN_ARR[@]}"
# Renew certs
else