Hi Team, The lab “RUN CIS BENCHMARK ASSESSMENT TOOL ON UBUNTU” Assessor-CLI.sh i . . .

HM:
Hi Team,
The lab “RUN CIS BENCHMARK ASSESSMENT TOOL ON UBUNTU”
Assessor-CLI.sh is not working.

root@controlplane:~/Assessor-CLI# sh ./Assessor-CLI.sh
./Assessor-CLI.sh: 38: ./Assessor-CLI.sh: Syntax error: end of file unexpected (expecting "fi")

root@controlplane:~/Assessor-CLI# tail -10 Assessor-CLI.sh
        echo ""
        echo "You must use Java 1.8.x, or higher. The most recent version of Java is recommended."
        exit 1;
fi

if [ $DEBUG -eq "1" ]; then
        echo "Executing CIS-CAT Pro Assessor from $SCRIPTPATH"
        $JAVA -Xmx${MAX_RAM_IN_MB}M -jar $SCRIPTPATH/Assessor-CLI.jar "$@" --verbose
else
        $JAVA -Xmx${MAX_RAM_IN_MB}M -jar $SCRIPTPATH/Assessor-CLI.jar "$@"
root@controlplane:~/Assessor-CLI# 

unnivkn:
Hint: Use sh ./Assessor-CLI.sh to see all available options.
Use the correct option to set the output directory and override the default report name.
Click on Assessment Report tab to see the report.

Solution:
cd /root/Assessor-CLI
sh ./Assessor-CLI.sh -i -rd /var/www/html/ -nts -rp index

-rp,–report-prefix <REPORT-PREFIX>
-nts,–no-timestamp –> Do not include the auto-generated timestamp as part of the report name.
-rd,–reports-dir <REPORTS-DIR> –> Path to a directory specifying the location to which output reports are saved

Carlo Columna:
Had the same issue as @HM, fixed the script by closing the last if statement. in other words just add fi in the end

HM:
@Carlo Columna I did it, script succeed. But cannot pass the validation of the lab, don’t know why.