mirror of https://github.com/CISOfy/lynis.git
SSH-7408: use only the last occurrence of a configured option
This commit is contained in:
parent
94d0aaf8d4
commit
62f31a8b82
|
@ -129,7 +129,8 @@
|
|||
WEAKVALUE=`echo ${I} | cut -d ':' -f2 | cut -d',' -f3`
|
||||
TESTTYPE=`echo ${I} | cut -d ':' -f3`
|
||||
RESULT="NONE"
|
||||
FOUNDVALUE=`awk -v OPT="${OPTIONNAME}" 'index($0, OPT) == 1 { print toupper($2) }' ${SSH_DAEMON_CONFIG}`
|
||||
# Get value and use the last occurrence
|
||||
FOUNDVALUE=`awk -v OPT="${OPTIONNAME}" 'index($0, OPT) == 1 { print toupper($2) }' ${SSH_DAEMON_CONFIG} | tail -1`
|
||||
LogText "Test: Checking ${OPTIONNAME} in ${SSH_DAEMON_CONFIG}"
|
||||
|
||||
if [ ! "${FOUNDVALUE}" = "" ]; then
|
||||
|
|
Loading…
Reference in New Issue