#!/bin/bash

# get the TOP dir if passed in
if [ "X$1" != "X" ]; then
    TOP=$1
    echo "Setting WPC TOP to $TOP"
fi

CURRENTDIR=`pwd`	

# check .pid files in $TOP/logs/diagnostic/system_status, and kill corresponding process
cd $TOP/logs/diagnostic/system_status
PID=`cat $TOP/logs/diagnostic/system_status/monitor.pid`

if [ -r "monitor.pid" ]; then
    ${ECHO} "killing system monitor process: $PID"
    kill -9 $PID > /dev/null 2>&1
    ${RM} monitor.pid
fi

cd $CURRENTDIR

exit 0 
