From 0728751208b9eaddd1734fe44046ee7c48705db3 Mon Sep 17 00:00:00 2001 From: Richard Soderberg Date: Sat, 5 Sep 2015 00:03:55 -0700 Subject: [PATCH] move bash4 detection as early as possible in the script to permit logic later on --- cipherscan | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cipherscan b/cipherscan index 21d52c6..b80d347 100755 --- a/cipherscan +++ b/cipherscan @@ -10,6 +10,14 @@ DOBENCHMARK=0 BENCHMARKITER=30 + +# cipherscan requires bash4, which doesn't come by default in OSX +if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then + echo "Bash version 4 is required to run cipherscan." + echo "Please upgrade your version of bash (ex: brew install bash)." + exit 1 +fi + DIRNAMEPATH=$(dirname "$0") REALPATH="$DIRNAMEPATH" # make sure this doesn't error out when readlink -f isn't available (OSX) @@ -25,13 +33,6 @@ if ! [[ $OPENSSLBINHELP =~ -connect ]]; then exit 1 fi -# cipherscan requires bash4, which doesn't come by default in OSX -if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then - echo "Bash version 4 is required to run cipherscan." - echo "Please upgrade your version of bash (ex: brew install bash)." - exit 1 -fi - # test that timeout or gtimeout (darwin) are present TIMEOUTBIN="$(which timeout)"