• shell 脚本启动tomcat服务


    #!/bin/bash
    
    
    # kill tomcat进程
    tomcat_fashion_dev_pid=`ps aux|grep tomcat_fashion_dev|grep -v "grep"|awk '{print $2}'`
    
    if [ "$tomcat_fashion_dev_pid" ];then
        ps aux|grep tomcat_fashion_dev|grep -v "grep"|awk '{print $2}'|xargs kill -9 
        echo "old tomcat fashion dev  process  is killed"
    fi
    
    
    rm -rf  /home/deploy/fashion/dev/deploy_files/*
    
    echo "delete old  project files /home/deploy/fashion/dev/deploy_files"
    
    
    #解压war包到 代码执行地方
    
    cd /home/deploy/fashion/dev/
    unzip -oq fashion.war -d /home/deploy/fashion/dev/deploy_files/
    
    
    #重启tomcat
    cd /home/deploy/tomcat_fashion_dev/bin
    sh startup.sh
    
    sleep 5
    tomcatport=` netstat -lntp|grep "8080"|awk '{print $4}'|awk -F":" '{print $2}'`
    echo $tomcatport
    
    if [ "$tomcatport" ];then
              echo -e "33[32m[ tomcat fashion   started success on dev env !  ]33[0m"
    fi
    

      

  • 相关阅读:
    Extended Traffic LightOJ
    SPFA()判环
    Ignatius and the Princess IV HDU 1029
    DNA sequence HDU
    Eight HDU
    哈密顿绕行世界问题 HDU2181
    F
    E
    Hash记录字符串
    无序map 记录一下
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/10172912.html
Copyright © 2020-2023  润新知