export base_path=/usr/local
export JAVA_HOME=/usr/local/ehrapp/tomcat/bin/jdk
kill -9 $(ps -aef|grep tomcat/conf|grep -v grep |awk '{print $2}')
mv -f $base_path/ehrapp/ehr-test.zip $base_path/ehrapp/ehr-test_bak.zip
cd $base_path/ehrapp/tomcat/webapps
rm -rf ROOT
mkdir ROOT
cp -f $base_path/ehr-test.zip $base_path/ehrapp/tomcat/webapps/ROOT/ehr-test.war
cd $base_path/ehrapp/tomcat/webapps/ROOT
$JAVA_HOME/bin/jar -xvf ehr-test.war
mv -f ehr-test.war $base_path/ehrapp/ehr-test.zip
cp -f $base_path/cfg.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/cfg.properties
cp -f $base_path/wechat.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/wechat.properties
cp -f $base_path/moxueyuan.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/moxueyuan.properties
cp -f $base_path/wxwork.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/wxwork.properties
cp -f $base_path/hengshi.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/hengshi.properties
cp -f $base_path/dingtalk.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/dingtalk.properties
cp -f $base_path/favicon.ico $base_path/ehrapp/tomcat/webapps/ROOT/favicon.ico
cp -f $base_path/ddguanhuai.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/ddguanhuai.properties
cp -f $base_path/feishu.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/feishu.properties
cp -f $base_path/fadada.properties $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/properties/fadada.properties
cp -f $base_path/spring-sms.xml $base_path/ehrapp/tomcat/webapps/ROOT/WEB-INF/config/spring-sms.xml
rm -rf $base_path/ehrapp/tomcat/logs/*
rm -rf $base_path/ehrapp/tomcat/work/*