#!/bin/bash PID=$(ps -ef | grep simulation-resource-scheduler-1.0.jar | grep java | awk '{ print $2 }') if [ -z "$PID" ] then echo Application is already stopped else echo kill $PID kill $PID fi