#!/bin/bash
filename=$1
echo "===开始升级8.5.82-8.5.92==="
echo "备份中。。。。。。"
mv /home/tomcat/${filename} /home/tomcat/${filename}-bak
sleep 3
echo "升级中。。。。。"
cp -rp /home/tomcat/apache-tomcat-8.5.92-src /home/tomcat/${filename}
echo "初始化完成===="
rm -rf /home/tomcat/${filename}/webapps/*
echo "配置还原更新。。。。"
mv /home/tomcat/${filename}/conf/server.xml /home/tomcat/${filename}/conf/server.xml.bak
cp -rp /home/tomcat/${filename}-bak/webapps/* /home/tomcat/${filename}/webapps/
cp -rp /home/tomcat/${filename}-bak/conf/server.xml /home/tomcat/${filename}/conf/
echo "升级完成!!!"
echo "启动服务"
/bin/sh /home/tomcat/${filename}/bin/catalina.sh start
ps -ef | grep ${filename}