diff --git a/start.letsencrypt.sh b/start.letsencrypt.sh index 0070cd9..66e7ae7 100755 --- a/start.letsencrypt.sh +++ b/start.letsencrypt.sh @@ -43,9 +43,9 @@ create_json() { TMP_FILE=$(mktemp) jq ' if . == null or . == [] then - [{"'$DOMAIN'":{"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'"}}] + {"'$DOMAIN'":{"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'"}} else - (map(select(has("'$DOMAIN'") | not))) + [{"'$DOMAIN'":{"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'"}}] + (map(select(has("'$DOMAIN'") | not))) + {"'$DOMAIN'":{"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'"}} end ' $LETSENCRYPT_OUTPUT >$TMP_FILE cat $TMP_FILE >$LETSENCRYPT_OUTPUT @@ -110,7 +110,7 @@ LETSENCRYPT_FILE=$(find /etc/ssl/keys/ -type f -name letsencrypt) if [ "$DOMAIN" != "localhost" ]; then if [ ! -f $LETSENCRYPT_OUTPUT ]; then install -m 664 -g 65534 /dev/null $LETSENCRYPT_OUTPUT - echo '[]' >$LETSENCRYPT_OUTPUT + echo '{}' >$LETSENCRYPT_OUTPUT fi if [ "$DOMAIN" != "" ]; then