jenkins构建maven项目配置

2024-02-24  本文已影响0人  追风还是少年
image.png image.png image.png image.png image.png image.png
#!/bin/bash
rm -rf xxoo

appname=$1
echo 'arg:$1'


pid=`ps -ef | grep $appname | grep 'java -jar' | awk '{printf $2}'`

echo $pid

# -z 做控制判?
if [ -z $pid ];
then
    echo "$appname not started"

else

    kill -9 $pid
    echo "$appname stoping...."
fi

# -w 精?匹配
check=`ps -ef|grep -w $pid |grep java`
if [ -z $check ];
then
    echo "$appname pid:$pid is stoped"
else
    echo "$appname stop failed" 
fi

上一篇 下一篇

猜你喜欢

热点阅读