mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-30 09:14:18 +02:00
Allow additional profile with --profile
This commit is contained in:
parent
7823cf60f5
commit
904da4d123
@ -151,6 +151,7 @@ unset LANG
|
|||||||
RUN_TESTS=1
|
RUN_TESTS=1
|
||||||
SAMHAINBINARY=""
|
SAMHAINBINARY=""
|
||||||
SCAN_TEST_HEAVY=""; SCAN_TEST_MEDIUM=""; SCAN_TEST_LOW=""
|
SCAN_TEST_HEAVY=""; SCAN_TEST_MEDIUM=""; SCAN_TEST_LOW=""
|
||||||
|
SEARCH_PROFILES=""
|
||||||
SESTATUSBINARY=""
|
SESTATUSBINARY=""
|
||||||
SERVICE_MANAGER=""
|
SERVICE_MANAGER=""
|
||||||
SHELL_IS_BUSYBOX=0
|
SHELL_IS_BUSYBOX=0
|
||||||
|
@ -207,7 +207,7 @@
|
|||||||
# Define a custom profile file
|
# Define a custom profile file
|
||||||
--profile)
|
--profile)
|
||||||
shift
|
shift
|
||||||
PROFILE=$1
|
SEARCH_PROFILES=$1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Define a custom plugin directory
|
# Define a custom plugin directory
|
||||||
|
10
lynis
10
lynis
@ -259,11 +259,17 @@ ${NORMAL}
|
|||||||
for PLOC in ${tPROFILE_TARGETS}; do
|
for PLOC in ${tPROFILE_TARGETS}; do
|
||||||
FILE="${PLOC}/${PNAME}"
|
FILE="${PLOC}/${PNAME}"
|
||||||
if [ -r ${FILE} ]; then
|
if [ -r ${FILE} ]; then
|
||||||
PROFILE=${FILE}
|
PROFILES="${PROFILES} ${FILE}"
|
||||||
PROFILES="${PROFILES} ${PROFILE}"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
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
|
fi
|
||||||
if [ "${PROFILES}" = "" ]; then
|
if [ "${PROFILES}" = "" ]; then
|
||||||
echo "${RED}Fatal error: ${WHITE}No profile defined and could not find default profile${NORMAL}"
|
echo "${RED}Fatal error: ${WHITE}No profile defined and could not find default profile${NORMAL}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user