blob: 7b32b8588c28d469dffc8eebc0189cdb69ab7d23 [file] [log] [blame]
#!/bin/bash
# get the PIDs of java processes we started
if [ "$JAVA_HOME" != "" ]
then
PIDS=`$JAVA_HOME/bin/jps`
else
PIDS=`jps`
fi
while IFS='\n' read -ra MYPIDS; do
for i in "${MYPIDS[@]}"; do
pid=`echo $i | grep 'CCDriver\|NCDriver\|VirtualClusterDriver' | awk '{print $1}'`
name=`echo $i | grep 'CCDriver\|NCDriver\|VirtualClusterDriver' | awk '{print $2}'`
if [ "$pid" != "" ]
then
echo "Stopping $name: $pid"
kill -9 $pid
fi
done
done <<< "$PIDS"