shutdown.sh

JarName=lishuoboy-***.jar

# 1、查找进程们(注意可能返回多个)
pIdArr=$(ps -ef | grep java | grep ${JarName} | grep "spring.profiles.active" | grep -v "grep" | awk '{print $2}')

# 2、遍历kill进程们
for pId in ${pIdArr}; do
kill -9 ${pId}
echo "进程:${pId} 被kill"
done