shutdown.sh 489 Bytes
#! /bin/sh
PORT="17211"
BASEDIR=`dirname $0`
BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="appbuild-manager"
MAIN_CLASS="$PROJECT_NAME";

if [ ! -n "$PORT" ]; then  
	echo $"Usage: $0 {port}"
	exit $FAIL
fi


pid=`ps ax | grep -i "$MAIN_CLASS"  | grep java | grep -v grep | awk '{print $1}'`
if [ -z "$pid" ] ; then
        echo "No Server running."
        exit -1;
fi

echo "stoping application $PROJECT_NAME......"

kill ${pid}

echo "Send shutdown request to Server $PROJECT_NAME OK"