Echo "******************* ESS starts upgrading ****************** **********"
Curdate = 'date' + % Y % m % d''
CP./applications/xxxx. Ear./applications/xxxx. Ear. back $ {curdate}
# Check whether the upgrade package has been uploaded
If [[-F./upload/xxxx. Ear]; then
Echo "******************* xxxx to be upgraded. the ear has uploaded *****************"
Else
Echo "******************* xxxx to be upgraded. the ear has not been uploaded, and the program exits *****************"
Exit
FI;
If [[-F./applications/xxxx. Ear. back $ {curdate}]; then
Echo ****************** **********"
# Stop a service
Counter = 'ps-Ef | grep wvpntest_peidw | grep-V grep | WC-l'
If ["$ counter"-EQ 0]; then
Echo "***************** no wvpntest_peidw process is running **************** *"
Else
Kill-9 'ps-Ef | grep wvpntest_peidw | grep-V grep | awk '{print $2 }''
Echo ****************** **********"
Fi
# Delete a service
Rm./applications/xxxx. Ear;
Echo "******************* XXXX. the ear is successfully deleted ***************************"
# Deploy the new XXXX. Ear
MV./upload/xxxx. Ear./applications/
If [[-F./applications/xxxx. Ear]; then
Echo "****************** new XXXX. ***********************"
Counter = 'ps-Ef | grep wvpntest_peidw | grep-V grep | WC-l'
If ["$ counter"-EQ 0]; then
Nohup startweblogic. Sh &
Echo "***************** wvpntest_peidw is successfully started ****************** *****"
Else
Echo "******************* warning, wvpntest_peidw has run *******************"
Fi
Fi
Else
Echo "******************* file backup failed, * exit ****************************"
Fi