thou shalt not kill
[feisty_meow.git] / scripts / processes / pszap.sh
diff --git a/scripts/processes/pszap.sh b/scripts/processes/pszap.sh
new file mode 100644 (file)
index 0000000..31e119f
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+if [ -z "$1" ]; then
+  echo "Did not find a parameter to seek out and whack from the process list."
+  exit 2
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+PIDLIST=$(psfind $1)
+#echo "PIDS are $PIDLIST"
+if [ -z "$PIDLIST" ]; then
+  echo "Your process name was not found in the system."
+  exit 1
+fi
+echo "Here are the processes matching your pattern:"
+ps $PIDLIST
+echo "Are you sure you want to kill all of these? [y/N] "
+read answer
+if [ "$answer" = "Y" -o "$answer" = "y" ]; then
+  kill -9 $PIDLIST
+else
+  echo "You chose not to zap the processes."
+fi
+