# jenkins shell
#!/bin/bashpid=$(ps -ef | grep jenkins | wc -l)
echo $pid if [ "$1" = "start" ];thenif [[ $pid -eq 2 ]];thenecho 'jenkins is running...'
else### java启动服务 配置java安装根路径,和启动war包存的根路径#nohup java -jar /etc/ansible/code/jenkins.war --httpPort=8081 2>&1 &nohup java -jar /etc/ansible/code/jenkins.war --httpPort=8081 >jenjins.log 2>&1 &echo "nohup start jenkins.war"fielif [ "$1" = "stop" ];thenexec ps -ef | grep jenkins | grep -v grep | awk '{print $2}'| xargs kill -9echo 'jenkins is stop..'
elseecho "Please input like this:"./jenkins.sh start" or "./jenkins stop""fi
# yangfeng shell
#!/bin/sh
## java env
export JAVA_HOME=/apps/java/jdk1.8.0_281
export JRE_HOME=$JAVA_HOME/jre
## exec shell name
# EXEC_SHELL_NAME=$1\.sh
## service nam