Refactor JSON creation in create_json function to enhance domain entry handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
gyurix
2025-03-15 00:20:41 +01:00
parent 0c3dccfa26
commit 3f2d75c086

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)) | from_entries) + {"'$DOMAIN'": {"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'" }}
. + {"'$DOMAIN'": {"date": "'$DATE'", "status": "'$STATUS'", "log": "'$LOG'"}}
end
' $LETSENCRYPT_OUTPUT >$TMP_FILE
cat $TMP_FILE >$LETSENCRYPT_OUTPUT