SSH-7408: use only the last occurrence of a configured option

This commit is contained in:
mboelen 2016-03-08 08:47:25 +01:00
parent 94d0aaf8d4
commit 62f31a8b82
1 changed files with 2 additions and 1 deletions

View File

@ -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