停止正在运行中的jar包
2021年12月25日小于 1 分钟
谨慎使用,该命令为终止
#!/bin/bash
PID=$(ps -ef | grep sample-****.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill -9 $PID
kill -9 $PID
fi
终止
#!/bin/bash
PID=$(ps -ef | grep sample-****.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill -9 $PID
kill -9 $PID
fi