From 68cb4931173f013caef94ad34042a75c440c2195 Mon Sep 17 00:00:00 2001 From: Razvan Stoica Date: Fri, 19 Mar 2021 09:29:55 +0200 Subject: [PATCH] Log the remediation measure in JSON file only if the -p flag is not set --- functions/output_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/output_lib.sh b/functions/output_lib.sh index f893cb5..6fd1ce7 100644 --- a/functions/output_lib.sh +++ b/functions/output_lib.sh @@ -163,7 +163,7 @@ logcheckresult() { fi # 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 if [ -n "$remediationImpact" ]; then printf ", \"remediation-impact\": \"%s\"" "$remediationImpact" | tee -a "$logger.json" 2>/dev/null 1>&2