From 62f31a8b82c5383285071f91a9ff30b8f3316e10 Mon Sep 17 00:00:00 2001 From: mboelen Date: Tue, 8 Mar 2016 08:47:25 +0100 Subject: [PATCH] SSH-7408: use only the last occurrence of a configured option --- include/tests_ssh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/tests_ssh b/include/tests_ssh index 922daf21..ff0a3811 100644 --- a/include/tests_ssh +++ b/include/tests_ssh @@ -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