Refactor JSON creation in start.letsencrypt.sh to improve domain entry handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
gyurix
2025-03-14 20:36:51 +01:00
parent d682f43489
commit 0c3dccfa26

View File

@@ -45,7 +45,7 @@ create_json() {
if . == null or . == [] then
{"'$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)) | from_entries) + {"'$DOMAIN'": {"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'" }}
end
' $LETSENCRYPT_OUTPUT >$TMP_FILE
cat $TMP_FILE >$LETSENCRYPT_OUTPUT