部署包路径:/usr/local/tomcat/webapps
restart.sh放在tomcat的bin目录下:
#!/bin/sh export JAVA_HOME=/usr/local/jdk/jdk1.8.0_111 echo "JAVA_HOME PATH $JAVA_HOME" sh /usr/local/tomcat/bin/catalina.sh stop rm -rf /usr/local/tomcat/webapps/ROOT rm -rf /usr/local/tomcat/webapps/ROOT.war tar -zxvf /usr/local/tomcat/webapps/package.tgz -C /usr/local/tomcat/webapps sleep 2 mv /usr/local/tomcat/webapps/mall.war /usr/local/tomcat/webapps/ROOT.war sh /usr/local/tomcat/bin/catalina.sh start