linux 下停止java jar包 shell

时间:2023-03-08 16:02:13

linux 下停止java jar包 shell

http://injavawetrust.iteye.com

#!/bin/sh

APP_HOME=/home/ap/injavawetrust/batch
cd $APP_HOME
if [ -f BatchClient.pid ]; then
PID=$(cat BatchClient.pid)
kill -9 $PID
rm -f BatchClient.pid

echo "==========================="
echo "PID is $PID"

echo "stopping service ......."
sleep 1
 if [ -f BatchClient.pid ]; then

echo "stop service  fail"
  else
     echo  "stop service sucess"
  fi
else
 echo "==========================="
echo "warn:service is not started"
echo "==========================="
fi