#!/bin/bashcd`dirname $0`BIN_DIR=`pwd`DEPLOY_DIR=`pwd`LOGS_DIR=$DEPLOY_DIR/logs
STDOUT_FILE=$LOGS_DIR/stdout.log
filename=`ls-t ./ |grep .jar$`PID=`ps-ef|grep-vgrep|grep"$filename"|awk'{print $2}'`echo"PID: $PID"if[-z"$PID"];thenecho"ERROR: The lark server does not started!"exit1fiecho-e"Stopping the lark server ...\c"kill$PID>$STDOUT_FILE2>&1COUNT=0while[$COUNT-lt1];doecho-e".\c"sleep1COUNT=1PID_EXIST=`ps-f-p $PID |grepjava`if[-n"$PID_EXIST"];thenCOUNT=0fidoneecho"stopped"echo"PID: $PID"