Enhanced scoring when only INFO is detected

This commit is contained in:
Toni de la Fuente
2021-11-08 22:44:41 +01:00
parent 7b6e4ccd13
commit 60d89fa98d

View File

@@ -23,7 +23,14 @@ scoring(){
# TOTAL_RESOURCES=$(awk "BEGIN {print $FAIL_COUNTER+$PASS_COUNTER; exit}")
TOTAL_RESOURCES=$(($FAIL_COUNTER + $PASS_COUNTER))
# Score is % of passed compared to failures. The higher the better
PROWLER_SCORE=$(( $PASS_COUNTER * 100 / $TOTAL_RESOURCES ))
if [[ $PASS_COUNTER == "0" ]]; then
PROWLER_SCORE="0"
else
PROWLER_SCORE=$(( $PASS_COUNTER * 100 / $TOTAL_RESOURCES ))
fi
CHECKS_COUNTER=$((CHECKS_COUNTER-1))
if [[ $SCORING == "1" ]]; then
echo -e "$BLUE------------------------------------------------------------------ $NORMAL"