Fix list-reversal (and comment)

Use "tac" (which reverses things) rather than "sort -r" (which will
reverse a list only if it was sorted already).

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
This commit is contained in:
Thomas Sanders 2015-07-10 17:57:48 +01:00
parent 2157342d89
commit 7a4106e839

View File

@ -1439,7 +1439,7 @@ server_preference() {
ret=6
else
cipher1=$(grep -wa Cipher $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')
list2=$(echo $list1 | tr ':' '\n' | sort -r | tr '\n' ':') # pr_reverse the list
list2=$(echo -n $list1':' | tac -s':' | sed -e 's/:$//') # reverse the list
$OPENSSL s_client $STARTTLS -cipher $list2 -connect $NODEIP:$PORT $PROXY $SNI </dev/null 2>/dev/null >$TMPFILE
cipher2=$(grep -wa Cipher $TMPFILE | egrep -avw "New|is" | sed -e 's/^ \+Cipher \+://' -e 's/ //g')