#!/bin/bash
BASE_DIR="$(cd "$(dirname "$0")"; pwd)";
cd $BASE_DIR/../

PID=`ps -ef | grep java | grep scouter-server-boot.jar | awk '{print $2}'`

if [ e$PID == "e" ] ; then
    logger -s "Scouter server is not running."
    exit;
fi

ps -ef | grep java | grep scouter-server-boot.jar | awk {'print "kill -9 " $2'} | sh -x
rm -f *.scouter
rm -f database/lock.dat
