#!/bin/bash
jarName=forwe-bp.jar
shutdownWait=3
pid=$(ps -ef | grep ${jarName} | grep -v grep | awk '{ print $2 }')
if [ -z "$pid" ]
then
	echo -e "\033[31m服务未运行\033[0m"
else
	kill $pid
	count=0;
    let kwait=$shutdownWait
    until [ `ps --pid $pid | grep -c $pid` = '0' ] || [ $count -gt $kwait ]
    do
        echo -n -e ".";
        sleep 1
        let count=$count+1;
    done
    printf "\n服务已停止\n" 
fi	
