linux 下停止java jar包 shell

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

你可能感兴趣的:(shell,liux)