jenkins的启动和停止
1.创建脚本jenkins.sh#!/bin/bashpid=`ps -ef | grep jenkins.war | grep -v 'grep'| awk '{print $2}'| wc -l`if [ "$1" = "start" ];thenif [ $pid -gt 0 ];thenecho 'jenkins is running...'
·
1.创建脚本jenkins.sh
#!/bin/bash
pid=`ps -ef | grep jenkins.war | grep -v 'grep'| awk '{print $2}'| wc -l`
if [ "$1" = "start" ];then
if [ $pid -gt 0 ];then
echo 'jenkins is running...'
else
java -jar /opt/grow/jenkins.war --httpPort=8060 >/dev/null 2>&1 &
fi
elif [ "$1" = "stop" ];then
exec ps -ef | grep jenkins | grep -v grep | awk '{print $2}'| xargs kill -9
echo 'jenkins is stop..'
else
echo "Please input like this:"./jenkins.sh start" or "./jenkins stop""
fi
2.启动和停止jenkins
./jenkins.sh start
./jenkins.sh stop
更多推荐
已为社区贡献1条内容
所有评论(0)