31e119f838bd215c738e2f786f5aa2377e25ef05
[feisty_meow.git] / scripts / processes / pszap.sh
1 #!/bin/bash
2 if [ -z "$1" ]; then
3   echo "Did not find a parameter to seek out and whack from the process list."
4   exit 2
5 fi
6
7 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
8
9 PIDLIST=$(psfind $1)
10 #echo "PIDS are $PIDLIST"
11 if [ -z "$PIDLIST" ]; then
12   echo "Your process name was not found in the system."
13   exit 1
14 fi
15 echo "Here are the processes matching your pattern:"
16 ps $PIDLIST
17 echo "Are you sure you want to kill all of these? [y/N] "
18 read answer
19 if [ "$answer" = "Y" -o "$answer" = "y" ]; then
20   kill -9 $PIDLIST
21 else
22   echo "You chose not to zap the processes."
23 fi
24