#!/bin/bash

app_name='devops-agent.jar'
pid=`ps -ef | grep ${app_name} | grep -v grep | awk '{print $2}'`
if [[ -z ${pid} ]];
then
  echo ${app_name}" killed"
else
  echo "kill "${app_name}" with pid "${pid}
  kill -15 ${pid}
fi