bash cript to run cudahashcat as screensaver
#1
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
#2
killall cudaHashcat64.bin
#3
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.
#4
(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.