shell关闭___启动tomcat

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:~/bin
export 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_server
if [ $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_server
if [ $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_server
if [ $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_server
if [ $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_server
if [ $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_server
if [ $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_server
if [ $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 all
if [ $1 = "all" ];then
        ps x|grep tomcat|grep -v grep  |awk '{print $1}'|xargs kill -9
        echo "All server close success !"
        exit 0;
fi

echo "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:~/bin
export 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_server
if [ $1 = "youxi" ];then
        #省略#
        echo "youxi  server open success !"
        exit 0;
fi
#open member_server
if [ $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_server
if [ $1 = "iyouxi" ];then
        #省略#
        echo "iyouxi  server open success !"
        exit 0;
fi
#open yxuser-mina_server
if [ $1 = "yxuser-mina" ];then
        #省略#
        echo "yxuser-mina  server open success !"
        exit 0;
fi

#open script
if [ $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 test
if [ $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_me
if [ $1 = "plat_me" ];then
        #省略#
        echo "plat_me  server open success !"
        exit 0;
fi


#open all
if [ $1 = "all" ];then
        /home/scripts/close_tomcat.sh all;
       #省略#
        echo "all server open success !"
        exit 0;
fi

echo "You do NoThings!"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值