From 29643b343f2ba5a0c8bd45dc12d6cc4b5296cd00 Mon Sep 17 00:00:00 2001 From: philsmd <921533+philsmd@users.noreply.github.com> Date: Fri, 8 Mar 2019 16:37:10 +0100 Subject: [PATCH] tests: fixed -P command line argument The -P parameter was not correctly changing the OPTS command line argument to hashcat. This fix changes the way -O/-P are handled within test.sh, i.e. -O is set if -P was not specified and the OPTS argument list will be drafted accordingly. Thanks --- tools/test.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index 261b96bb8..b192df41e 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -5,7 +5,7 @@ ## License.....: MIT ## -OPTS="--quiet --potfile-disable --runtime 400 --hwmon-disable -O" +OPTS="--quiet --potfile-disable --runtime 400 --hwmon-disable" TDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -2668,7 +2668,6 @@ while getopts "V:t:m:a:b:hcpd:x:o:d:D:F:POI:s:" opt; do ;; "P") - OPTS="$(echo "${OPTS}" | sed 's/ -O$//' | sed 's/^-O //' | sed 's/ -O //')" OPTIMIZED=0 ;; @@ -2685,9 +2684,13 @@ done export IS_OPTIMIZED=${OPTIMIZED} +if [ "${OPTIMIZED}" -eq 1 ]; then + OPTS="${OPTS} -O" +fi + if [ "${TYPE}" == "null" ]; then - OPTS="${OPTS} -D 2" - TYPE="Gpu" + OPTS="${OPTS} -D 2" + TYPE="Gpu" fi if [ -n "${ARCHITECTURE}" ]; then