【Tomcat】重新獲得war包

Extract war in tomcat/webapps

#!/bin/bash
#-----------------------------------------------
# FileName: getwar.sh
# Reversion: 1.2
# Date: 2017/05/27
# Author: zhengwenqiang
# Email: zhengwenqiang@bonc.com.cn
# Description: Package war which has been configured in webapps,then throw them in the directory 'dist'.
# Notes: If you are going to execute this script on linux, \
#	you should  run the command "sed -i 's/\r//g' getwar.sh" \
#	to delete invalid character ^M generated by Notepad++ in Windows.
# Copyright: 2017(c) zhengwenqiang
# License: GPL
#-----------------------------------------------

[ -d dist ] || mkdir dist

rm dist/*.war -f

dest="`pwd`/dist"

cd webapps

function packWar(){

	if [ -d $1 ] ; then
		cd $1
		[ -f $1.war ] && rm -f $1.war
		jar cvf $1.war ./* && mv $1.war $dest
		cd -
	fi

}

for war in 'cas' 'portal' 'security'
do
	packWar $war
done 

echo "Job Finished!"

  

上一篇:MySQL--Percona-XtraDB-Cluster 5.6安装笔记


下一篇:CentOS7修改设置静态IP和DNS