hashcat Forum
bash cript to run cudahashcat as screensaver - Printable Version

+- hashcat Forum (https://hashcat.net/forum)
+-- Forum: Deprecated; Previous versions (https://hashcat.net/forum/forum-29.html)
+--- Forum: Old oclHashcat Support (https://hashcat.net/forum/forum-38.html)
+--- Thread: bash cript to run cudahashcat as screensaver (/thread-3769.html)



bash cript to run cudahashcat as screensaver - xoxox - 10-21-2014

Hi, I am trying to make a bash script that runs cudahashcat when xscreensaver goes on, and I am looking for a way to quit/exit hascat when the screensaver unblanks.
i tried various versions of killall pkill etc without luck.
i have been searching for a way to pass a 'q' to hashcat from the script to quit, also without luck. (new to bash)
thanks in advance.

my script looks like this:

!/bin/bash
process() {
while read input; do
case "$input" in

UNBLANK*)
echo "Unblank - kill cudaHascat session"

killall cudaHashcat somehow
;;

BLANK*)
echo "Blank - restore cudaHashcat session";
cudaHashcat arguments bla bla bla
;;

esac
done
}

/usr/bin/xscreensaver-command -watch | process


RE: bash cript to run cudahashcat as screensaver - epixoip - 10-21-2014

killall cudaHashcat64.bin


RE: bash cript to run cudahashcat as screensaver - xoxox - 10-21-2014

hi, thanks. i tried that also didnt work.
until now Big Grin

i put a & after the line that executes hashcat and a sudo in front of killall.
now it works.
wonder why sudo is necessary? i run the script as root or with sudo.
anyhow thanks.


RE: bash cript to run cudahashcat as screensaver - coolbry95 - 10-21-2014

(10-21-2014, 01:58 PM)xoxox Wrote: hi, thanks. i tried that also didnt work.
until now Big Grin

i put a & after the line that executes hashcat and a sudo in front of killall.
now it works.
wonder why sudo is necessary? i run the script as root or with sudo.
anyhow thanks.

If you run the script as root or with sudo you have to have to same amount of privileges to kill it.