#!/bin/sh
AppName=agileboot-api.jar
APP_HOME=$(cd $(dirname $0); pwd)
JAR_PATH=$APP_HOME/lib/$AppName

PID=$(ps -ef | grep java | grep $JAR_PATH | grep -v grep | awk '{print $2}')
if [ -n "$PID" ]; then
    kill -9 $PID
    echo "Application stopped"
else
    echo "Application is not running"
fi