启动 打包
#!/bin/bash
PROJECTNAME=RangerALdapApi
pid=`ps -ef |grep $PROJECTNAME |grep -v "grep" |awk '{print $2}'`
if [ $pid ]; then
echo "$PROJECTNAME is running and pid=$pid"
else
echo "Start success to start $PROJECTNAME ...."
nohup java -jar RangerALdapApi-0.0.1-SNAPSHOT.jar >> catalina.out 2>&1 &
fi
停止 Java包运行
#!/bin/bash
PROJECTNAME=RangerALdapApi
pid=`ps -ef |grep $PROJECTNAME |grep -v "grep" |awk '{print $2}' `
if [ $pid ]; then
echo "$PROJECTNAME is running and pid=$pid"
kill -9 $pid
if [[ $? -eq 0 ]];then
echo "sucess to stop $PROJECTNAME "
else
echo "fail to stop $PROJECTNAME "
fi