shell关闭___启动tomcat

来源:互联网 发布:软件开发模式有几种 编辑:程序博客网 时间:2024/06/06 03:06

CLOSE

#!/bin/bash#Program:#               This program will killed tomcat#History#       2016/02/24 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH#ISNULL?if [ ! $1 ];then        echo "You should do like this './close_tomcat.sh [youxi | member | iyouxi | yxuser-mina | all ]'"        exit 0;fi#close youxi_serverif [ $1 = "youxi" ];then        ps x|grep tomcat_youxi_web|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "youxi  server close success !"        exit 0;fi#close member_serverif [ $1 = "member" ];then        ps x|grep tomcat-7_member-web|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "member  server close success !"        exit 0;fi#close iyouxi_serverif [ $1 = "iyouxi" ];then        ps x|grep tomcat-7_iyouxi-web|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "iyouxi  server close success !"        exit 0;fi#close yxuser-mina_serverif [ $1 = "yxuser-mina" ];then        ps x|grep tomcat-7_yxuser-mina|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "yxuser-mina  server close success !"        exit 0;fi#close script_serverif [ $1 = "script" ];then        ps x|grep tomcat-7-script|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "script  server close success !"        exit 0;fi#close plat_me_serverif [ $1 = "plat_me" ];then        ps x|grep tomcat_plat_me|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "plat_me  server close success !"        exit 0;fi#close test_serverif [ $1 = "test" ];then        ps x|grep tomcat-7_test|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "test_server  server close success !"        exit 0;fi#close allif [ $1 = "all" ];then        ps x|grep tomcat|grep -v grep  |awk '{print $1}'|xargs kill -9        echo "All server close success !"        exit 0;fiecho "You do NoThings !"

OPEN

#!/bin/bash#Program:#               This program will killed tomcat#History#       2016/02/24 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH#ISNULL?if [ ! $1 ];then        echo "You should do like this './open_tomcat.sh [youxi | member | iyouxi | yxuser-mina | script | test | plat_me | all ]'"        exit 0;fi#open youxi_serverif [ $1 = "youxi" ];then        #省略#        echo "youxi  server open success !"        exit 0;fi#open member_serverif [ $1 = "member" ];then        /home/scripts/close_tomcat.sh member;        /home/web/tomcat-7_member-web/bin/catalina.sh start;        echo "member  server open success !"        exit 0;fi#open iyouxi_serverif [ $1 = "iyouxi" ];then        #省略#        echo "iyouxi  server open success !"        exit 0;fi#open yxuser-mina_serverif [ $1 = "yxuser-mina" ];then        #省略#        echo "yxuser-mina  server open success !"        exit 0;fi#open scriptif [ $1 = "script" ];then        /home/scripts/close_tomcat.sh script;        /home/temp/test/tomcat-7-script/bin/catalina.sh start;        echo "script  server open success !"        exit 0;fi#open testif [ $1 = "test" ];then        /home/scripts/close_tomcat.sh test;        /home/temp/test/tomcat-7_test/bin/catalina.sh start;        echo "test  server open success !"        exit 0;fi#open plat_meif [ $1 = "plat_me" ];then        #省略#        echo "plat_me  server open success !"        exit 0;fi#open allif [ $1 = "all" ];then        /home/scripts/close_tomcat.sh all;       #省略#        echo "all server open success !"        exit 0;fiecho "You do NoThings!"
0 0