Shell Script Combat

Source: Internet
Author: User

Want to write a script, found that all forget, egg pain, while recalling the side of the writing, finally finished, affixed to the following:

1#!/bin/Bash2 #Program:3 # can help you quickly redeploy the project4 #History:5# ./ ,/TenShichaogeng First release6 7 #variable8jar_file="Usp-lm-1.1.4.jar"9project="USP-LM"Tenproject_path_prefix="/alidata/projects/" Oneproject_path_midfix="/atomcat/webapps/" Aproject_path_suffix="/web-inf/lib" -Source_path="/alidata/source_code/" -  the #accept The Parameters - if[!-N"${1}"]; Then -jar_file="${1}" - fi + if[!-N"${2}"]; Then -project="${2}" + fi A  at#judgeifexist - if[!-F"$source _path$jar_file"]; Then -     Echo "The jar is not a exist in the path $source _path" - fi - if[!-D"$project _path_prefix$project"]; Then -     Echo "The project is not a exist in the path $project _path_prefix" in fi -  to #ready + CD $project _path_prefix$project$project_path_midfix$project$project_path_suffix - RM-RF $jar _file the CP$source _path$jar_file./ *CD $project _path_prefix$project/Atomcat $pid=$ (PSx |grep "USP-LM"|grep-Vgrep|awk '{print $}')Panax Notoginseng Kill-9$pid - RM-RF logs/* the RM-RF work/* +  A #restart the ./bin/startup.sh + tail-f logs/catalina.out

Write this thing for an hour, laugh cry.

Shell Script Combat

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.