An automatically upgraded Shell

Source: Internet
Author: User

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.