IMP(shellcheck): replace ! -z by -n (SC2236)

This commit is contained in:
Thibault Ayanides
2020-12-04 15:14:18 +01:00
parent eaf56ca25e
commit d371b8d057
14 changed files with 29 additions and 30 deletions

View File

@ -12,7 +12,7 @@ test_audit() {
describe Tests purposely failing
local targetdir="/home/secaudit/world_writable_folder"
mkdir $targetdir || true
chmod 777 $targetdir
chmod 777 "$targetdir"
register_test retvalshouldbe 1
register_test contain "Some world writable directories are not on sticky bit mode"
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all

View File

@ -70,7 +70,7 @@ for target in $("$(dirname "$0")"/docker_build_and_run_tests.sh 2>&1 | grep "Sup
fi
done
if [[ ! -z "$failedtarget" && "$nowait" -eq 0 ]]; then
if [[ -n "$failedtarget" && "$nowait" -eq 0 ]]; then
echo -e "\nPress \e[1mENTER\e[0m to display failed test logs"
echo -e "Use \e[1m:n\e[0m (next) and \e[1m:p\e[0m (previous) to navigate between log files"
echo -e "and \e[1mq\e[0m to quit"