标签:bash echo exit jenkins cat res $1 重启 shell
devops-jenkins-master01]# cat console 脚本#! /usr/bin/bash
case $1 in
start)
echo "Jenkins:服务启动...";
su - jenkins -c "/chj/app/chj-jenkins-master/bin/catalina.sh start"
;;
stop)
echo "Jenkins:服务停止...";
su - jenkins -c "/chj/app/chj-jenkins-master/bin/catalina.sh stop"
;;
restart)
echo "Jenkins:服务重启...";
su - jenkins -c "/chj/app/chj-jenkins-master/bin/catalina.sh stop"
su - jenkins -c "/chj/app/chj-jenkins-master/bin/catalina.sh start"
;;
status)
echo "Jenkins:服务状态";
su - jenkins -c "/chj/app/chj-jenkins-master/bin/jenkins.status.sh"
;;
*)
echo "Useage: jenkins 服务启动 console.sh {start|stop|restart|status}"
exit 1
esac
标签:bash echo exit jenkins cat res $1 重启 shell
原文地址:http://blog.51cto.com/breaklinux/2153953