Refactor JSON creation in check_certificates.sh to use from_entries for improved data structure
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -32,7 +32,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
|
||||
|
Reference in New Issue
Block a user