echo "*****************Ess开始升级****************************"
curDate=`date '+%Y%m%d'`
cp ./applications/xxxx.ear ./applications/xxxx.ear.back${curDate}
#检查升级程序包是否已上传
if [[ -f ./upload/xxxx.ear ]];then
echo "*****************要升级的xxxx.ear已上传*****************"
else
echo "*****************要升级的xxxx.ear尚未上传,程序退出*****************"
exit
fi;
if [[ -f ./applications/xxxx.ear.back${curDate} ]];then
echo "*****************文件备份成功****************************"
#停掉服务
counter=`ps -ef | grep wvpntest_peidw | grep -v grep | wc -l`
if [ "$counter" -eq 0 ] ; then
echo "*****************没有wvpntest_peidw进程在运行*****************"
else
kill -9 `ps -ef|grep wvpntest_peidw |grep -v grep|awk '{print $2}'`
echo "*****************服务停止成功****************************"
fi
#删除服务
rm ./applications/xxxx.ear;
echo "*****************xxxx.ear删除成功***************************"
#部署新的xxxx.ear
mv ./upload/xxxx.ear ./applications/
if [[ -f ./applications/xxxx.ear ]];then
echo "*****************新xxxx.ear部署成功***********************"
counter=`ps -ef | grep wvpntest_peidw | grep -v grep | wc -l`
if [ "$counter" -eq 0 ] ; then
nohup startWebLogic.sh &
echo "*****************wvpntest_peidw启动成功***********************"
else
echo "*****************警告,wvpntest_peidw已运行*******************"
fi
fi
else
echo "*****************文件备份失败,程序退出****************************"
fi
1591

被折叠的 条评论
为什么被折叠?



