From de0ff9a42bd1823c4a570fc98ce9c72f8d1722c4 Mon Sep 17 00:00:00 2001 From: philsmd <921533+philsmd@users.noreply.github.com> Date: Fri, 17 May 2019 09:46:53 +0200 Subject: [PATCH] tab completion: allow using "install version" of hashcat With this little update we also allow the installed version of "hashcat" (e.g. in /usr/local/bin/hashcat) to work with the tab completion script (most importantly used for the "hashcat -I" device lists). --- extra/tab_completion/hashcat.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/extra/tab_completion/hashcat.sh b/extra/tab_completion/hashcat.sh index b9428f6f7..f17019a19 100644 --- a/extra/tab_completion/hashcat.sh +++ b/extra/tab_completion/hashcat.sh @@ -17,9 +17,17 @@ _hashcat_backend_devices () if [ ! -x "${executable}" ]; then executable="${HASHCAT_ROOT}"/hashcat.bin fi + + if [ ! -x "${executable}" ]; then + local which_hashcat=$(which hashcat 2>/dev/null) + + if [ -n "${which_hashcat}" ]; then + executable="${which_hashcat}" + fi + fi if [ ! -x "${executable}" ]; then - return "" + return fi # remove separator at the end (if present) @@ -134,7 +142,7 @@ _hashcat_backend_devices () continue fi - # we add it because we didn't find any conflict: + # we add it because we didn't find any conflicts: if [ -z "${hashcat_device_list}" ]; then hashcat_device_list="${device_str}"