#!/bin/bash 

PID=`lsof -i:8081| grep LISTEN |awk '{print $2}'` //获取端口号8081的线程pid
echo ${PID}
export BUILD_ID=dontKillMe
if [[ $PID -ge 0 ]];then 
    kill -9 $PID
fi
//执行启动
nohup /usr/local/java/jdk1.8.0_211/bin/java -jar /usr/local/workspace/order-main-1.0.0.jar > /usr/local/workspace/log/order.log 2>&1 &

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐