#!/bin/bash
#
# Description: Reset the unified JVM.
#
# Change Activity:
#   05/17/2007 P. Callaghan     - Initial version
#
#STARTUSAGE
#
# This script allows you to reset the unified JVM. One use might be to restart the JVM
# after changing some Java classes that you are testing.
#
# Usage:
#   resetjvm
#
#ENDUSAGE
#****************************************************************************

#pgidLine=$(ps -Afww | grep "java.*CMVC" | grep -v 'su -m' | grep -v grep)
pgidLine=$(ps -Afww | grep "java.*UnifiedStartup" | grep -v 'su -m' | grep -v grep)
pgid=$(echo $pgidLine | cut -d' ' -f2)
if [ -z $pgid ]; then
   exit 1
else
   echo "kill -s 15 $pgid"
   kill -s 15 $pgid
   exit $?
fi
