#!/bin/bash
for j in $(ps -ef |grep java |awk '{print $2}')
do
kill $j
done
sleep 10
rootdir="/usr/local/java/apache-tomcat-7.0.57/webapps/ROOT"
rootwar="/usr/local/java/apache-tomcat-7.0.57/webapps/ROOT.war"
webapps="/usr/local/java/apache-tomcat-7.0.57/webapps/"
wardir="/usr/local/java/wardir"
warfile="/usr/local/java/wardir/ROOT.war"
if [ -d "$rootdir" ]; then
echo "remove $rootdir"
rm -rf $rootdir
fi
if [ -f "$rootwar" ]; then
echo "remove $rootwar"
rm $rootwar
fi
if [ ! -d "$wardir" ]; then
echo "mkdir $wardir"
mkdir $wardir
fi
if [ -f "$warfile" ]; then
echo "cp $warfile to $webapps !"
cp $warfile $webapps
else
echo "$warfile not exist !"
fi
echo "ip address is 120.27.42.130 "
cd /usr/local/java/apache-tomcat-7.0.57/bin
./startup.sh
auto deploy
最新推荐文章于 2021-12-23 19:27:38 发布