Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Company large version automatic update script

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

The company's large version is updated and is not universal.

#! / bin/bash# For large version update# Usage:. / script file.zip# Author by liu 2017-07-04PWD = `pwd`Web _ URL= "/ data/isonev45" FILE= "$1" IP= `ifconfig | sed-En's if 127.0.0.1 if. If (addr:)? ([0-9] *\.) {3} [0-9] *). * /\ 2 and p' `Chart [- z $1] Then echo-e "\ 033 [31mErrorJournal Please Usage: $0 web-xxxx.zip\ 033 [0m" exitfi# determines whether a large version of zip package contains if [!-f "$WEB_URL/$1"] Then # echo-e "\ 033 [31m =\ 033 [0m" echo-e "\ 033 [31m such file No such file!\ 033 [0m" # echo-e "\ 033 [31m =\ 033 [0m" exitfi# creates a large version to update the web directory function mkdir_web () {if [- d $WEB_URL/new_web] Then echo-e "\ 033 [31m [new _ web] directory is exist, please delete.\ 033 [0m" exit else mkdir $WEB_URL/new_web fi} # extract the large version update package function unzip_web () {file= `echo $FILE | awk-F [.]'{print $2} '`if [$file= = zip] Then unzip $WEB_URL/$FILE-d $WEB_URL/new_web # echo "zip" elif [$file = = tar] Then tar zxvf $WEB_URL/$FILE-C $WEB_URL/new_web # echo "tar" else echo-e "\ 033 [32mError There are no file types\ 033 [0m "fi # unzip $1-d new_web} # Delete the old configuration file NEW_CONF_DIR=" $WEB_URL/new_web/WEB-INF/classes "function del_conf () {# NEW_CONF_DIR=" $WEB_URL/new_web/WEB-INF/classes "cd $NEW_CONF_DIR & & rm-rf *. Conf pigeonTags.properties pigeon.lic & & cd. & &\ rm-rf Is1AppMarketContext.xml sessionContext.xml fulltextsearch.xml crontab.xml pigeonContext.xml IsoneSaasEngine.xml web.xml crontab_empty.xml IsoneJobsContext.xml} # copy the existing configuration file function copy_conf () {CONF_DIR= "$WEB_URL/web/WEB-INF/classes" cp $CONF_DIR/*.conf $NEW_CONF_DIR; cp $CONF_DIR/pigeon.lic $NEW_CONF_DIR; cp $CONF_DIR/pigeonTags.properties $NEW_CONF_DIR Cd $CONF_DIR/.. & & cp Is1AppMarketContext.xml sessionContext.xml fulltextsearch.xml crontab.xml pigeonContext.xml IsoneSaasEngine.xml web.xml IsoneJobsContext.xml $WEB_URL/new_web/WEB-INF/.} # close tomcatfunction stop_tomcat () {PID= `ps-ef | grep java | grep isonev45 | awk'{print $2} '`kill-9$ PID} # back up the original web and upgrade webDATE= `date +% Y% m% d`function install_web () {cd $WEB_URL; mv web web$DATE Mv new_web web} # launch tomcatfunction start_tomcat () {$WEB_URL/apache-tomcat-7.0.32/bin/startup.sh} # startup function, update mkdir_webunzip_webdel_confcopy_confstop_tomcatinstall_webstart_tomcatif [$?-eq 0]; then echo echo-e "\ 033 [32m update complete, please visit http://$IP Test\ 033 [0m" echofi

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report