Allow additional profile with --profile

This commit is contained in:
mboelen 2016-04-23 17:55:32 +02:00
parent 7823cf60f5
commit 904da4d123
3 changed files with 10 additions and 3 deletions

View File

@ -151,6 +151,7 @@ unset LANG
RUN_TESTS=1
SAMHAINBINARY=""
SCAN_TEST_HEAVY=""; SCAN_TEST_MEDIUM=""; SCAN_TEST_LOW=""
SEARCH_PROFILES=""
SESTATUSBINARY=""
SERVICE_MANAGER=""
SHELL_IS_BUSYBOX=0

View File

@ -207,7 +207,7 @@
# Define a custom profile file
--profile)
shift
PROFILE=$1
SEARCH_PROFILES=$1
;;
# Define a custom plugin directory

10
lynis
View File

@ -259,11 +259,17 @@ ${NORMAL}
for PLOC in ${tPROFILE_TARGETS}; do
FILE="${PLOC}/${PNAME}"
if [ -r ${FILE} ]; then
PROFILE=${FILE}
PROFILES="${PROFILES} ${PROFILE}"
PROFILES="${PROFILES} ${FILE}"
fi
done
done
# Search any profiles defined with --profile
for FILE in ${SEARCH_PROFILES}; do
if [ -r ${FILE} ]; then
Debug "Found profile defined with --profile"
PROFILES="${PROFILES} ${FILE}"
fi
done
fi
if [ "${PROFILES}" = "" ]; then
echo "${RED}Fatal error: ${WHITE}No profile defined and could not find default profile${NORMAL}"