diff --git a/letsencrypt/config.json b/letsencrypt/config.json index 0eccdd2..bc91ecf 100644 --- a/letsencrypt/config.json +++ b/letsencrypt/config.json @@ -1,6 +1,6 @@ { "name": "Let's Encrypt", - "version": "0.2", + "version": "0.3", "slug": "letsencrypt", "description": "Manage let's encrypt certificate", "startup": "once", diff --git a/letsencrypt/run.sh b/letsencrypt/run.sh index 801c6ed..feb6739 100644 --- a/letsencrypt/run.sh +++ b/letsencrypt/run.sh @@ -17,11 +17,8 @@ if [ ! -f /data/certbot-auto ]; then chmod a+x certbot-auto fi -# Start program -if [ -d $CERT_DIR ]; then - /data/certbot-auto renew --non-interactive --config-dir $CERT_DIR --work-dir $WORK_DIR -else - # generate domains +# Generate new certs +if [ ! -d "$CERT_DIR" ]; then for line in $DOMAINS; do if [ -z "$DOMAIN_ARG" ]; then DOMAIN_ARG="-d $line" @@ -30,9 +27,14 @@ else fi done - /data/certbot-auto certonly --non-interactive --standalone --email "$EMAIL" --config-dir $CERT_DIR --work-dir "$DOMAIN_ARG" + echo "$DOMAINS" > /data/domains.gen + /data/certbot-auto certonly --non-interactive --standalone --email "$EMAIL" --config-dir "$CERT_DIR" --work-dir "$DOMAIN_ARG" + +# Renew certs +else + /data/certbot-auto renew --non-interactive --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" fi # copy certs to store -cp /data/letsencrypt/live/*/privkey.pem "/ssl/$KEYFILE" -cp /data/letsencrypt/live/*/fullchain.pem "/ssl/$CERTFILE" +cp "$CERT_DIR"/live/*/privkey.pem "/ssl/$KEYFILE" +cp "$CERT_DIR"/live/*/fullchain.pem "/ssl/$CERTFILE" diff --git a/samba/config.json b/samba/config.json index e917c1d..96a9079 100644 --- a/samba/config.json +++ b/samba/config.json @@ -3,7 +3,7 @@ "version": "0.3", "slug": "samba", "description": "Expose HassIO folders with samba", - "startup": "after", + "startup": "before", "boot": "auto", "ports": { "445/tcp": 445