jar 包启动自动脚本
2020-10-12 本文已影响0人
十二找十三
#!/bin/sh
source /etc/profile
source /root/.bash_profile
workdir=$(cd $(dirname $0); pwd)
jarname=im-1.0-SNAPSHOT.jar
echo "${jarname} start..."
ps -ef | grep ${jarname} | grep -v grep
if [ $? -ne 0 ]
then
echo "start ${jarname} process....."
cd $workdir
java -jar ${jarname} >> ./logs/start.log 2>&1 &
else
echo "${jarname} runing....."
fi