Added exit code to CIS_ROOT_DIR test def, optimized sed and sort

This commit is contained in:
thibault.dewailly
2016-04-20 11:29:44 +02:00
parent 1d7865dd68
commit 3ece442743
194 changed files with 195 additions and 19 deletions

View File

@ -20,6 +20,7 @@ AUDIT=0
APPLY=0
AUDIT_ALL=0
AUDIT_ALL_ENABLE_PASSED=0
CIS_ROOT_DIR=''
usage() {
cat << EOF
@ -94,6 +95,7 @@ else
. /etc/default/cis-hardening
if [ -z $CIS_ROOT_DIR ]; then
echo "No CIS_ROOT_DIR variable, aborting"
exit 128
fi
fi
@ -103,7 +105,7 @@ fi
[ -r $CIS_ROOT_DIR/lib/utils.sh ] && . $CIS_ROOT_DIR/lib/utils.sh
# Parse every scripts and execute them in the required mode
for SCRIPT in $(ls $CIS_ROOT_DIR/bin/hardening/*.sh | sort -V); do
for SCRIPT in $(ls $CIS_ROOT_DIR/bin/hardening/*.sh -v); do
info "Treating $SCRIPT"
if [ $AUDIT = 1 ]; then