Log the remediation measure in JSON file only if the -p flag is not set

This commit is contained in:
Razvan Stoica 2021-03-19 09:29:55 +02:00
parent cc8171fbfe
commit 68cb493117

View file

@ -163,7 +163,7 @@ logcheckresult() {
fi fi
# Log remediation measure to JSON # Log remediation measure to JSON
if [ -n "$remediation" ] && [ "$1" != "PASS" ]; then if [ -n "$remediation" ] && [ "$1" != "PASS" ] && [ "$printremediation" = "1" ]; then
printf ", \"remediation\": \"%s\"" "$remediation" | tee -a "$logger.json" 2>/dev/null 1>&2 printf ", \"remediation\": \"%s\"" "$remediation" | tee -a "$logger.json" 2>/dev/null 1>&2
if [ -n "$remediationImpact" ]; then if [ -n "$remediationImpact" ]; then
printf ", \"remediation-impact\": \"%s\"" "$remediationImpact" | tee -a "$logger.json" 2>/dev/null 1>&2 printf ", \"remediation-impact\": \"%s\"" "$remediationImpact" | tee -a "$logger.json" 2>/dev/null 1>&2