blob: 7b32b8588c28d469dffc8eebc0189cdb69ab7d23 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001#!/bin/bash
2
3# get the PIDs of java processes we started
4if [ "$JAVA_HOME" != "" ]
5then
6 PIDS=`$JAVA_HOME/bin/jps`
7else
8 PIDS=`jps`
9fi
10
11while IFS='\n' read -ra MYPIDS; do
12 for i in "${MYPIDS[@]}"; do
13 pid=`echo $i | grep 'CCDriver\|NCDriver\|VirtualClusterDriver' | awk '{print $1}'`
14 name=`echo $i | grep 'CCDriver\|NCDriver\|VirtualClusterDriver' | awk '{print $2}'`
15 if [ "$pid" != "" ]
16 then
17 echo "Stopping $name: $pid"
18 kill -9 $pid
19 fi
20 done
21done <<< "$PIDS"