#!/bin/sh
#kill tomcat pid
path="/../usr/local/test/"
tarPath="/../usr/local/"
pidlist=`ps -ef|grep tomcat6-box | grep -v "grep"|awk '{print $2}'`
#ps -u $USER|grep "java"|grep -v "grep"
if [ "$pidlist" = "" ]
then
echo "BOX服务已经停止"
else
for pid in ${pidlist}
{
kill -9 $pid
echo "KILL $pid:"
}
echo "BOX服务停止"
fi
#delete
cd "$path"tomcat6-box-I/webapps
rm -fr web
mkdir web
cd "$path"tomcat6-box-II/webapps
rm -fr web
mkdir web
cd "$path"tomcat6-box-III/webapps
rm -fr web
mkdir web
#tar
echo 开始解压文件:web.tar
tar -xf "$tarPath"web.tar -C "$path"tomcat6-box-I/webapps/web
tar -xf "$tarPath"web.tar -C "$path"tomcat6-box-II/webapps/web
tar -xf "$tarPath"web.tar -C "$path"tomcat6-box-III/webapps/web
echo 解压文件完毕
#sed
echo 开始修改配置文件
cd "$path"tomcat6-box-I/webapps/web/WEB-INF/classes/META-INF
sed -i 's/1099/10000/g' ext-spring-jmx.xml
sed -i 's/localhost/192.168.0.99/g' ext-spring-jmx.xml
cd "$path"tomcat6-box-II/webapps/web/WEB-INF/classes/META-INF
sed -i 's/1099/10001/g' ext-spring-jmx.xml
sed -i 's/localhost/192.169.0.99/g' ext-spring-jmx.xml
cd "$path"tomcat6-box-III/webapps/web/WEB-INF/classes/META-INF
sed -i 's/1099/10002/g' ext-spring-jmx.xml
sed -i 's/localhost/192.170.0.99/g' ext-spring-jmx.xml
echo 修改配置文件完毕
#start
echo 启动服务
cd "$path"tomcat6-box-I/bin;./startup.sh
echo BOX-I服务开启
cd "$path"tomcat6-box-II/bin;./startup.sh
echo BOX-II服务开启
cd "$path"tomcat6-box-III/bin;./startup.sh
echo BOX-III服务开启
echo 服务启动完毕
分享到:
相关推荐
这里面包含了常用shell脚本实例,适合初学者学习
包含各种常见的典型的Shell开发示例,支持c++/c#/VB语言。
Shell等待示例[ShellWait.rar]-精品源代码
Docker-shell脚本示例
多个Shell Extensions示例工程源代码.zip
自己总结的Linux_Shell_脚本讲解+示例
主要给大家介绍了关于shell中长命令的换行处理方法,文中通过示例代码介绍的非常详细,对大家学习或者使用shell具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
40个简单但有效的Linux Shell脚本示例.docx
常用shell示例脚本 按照 文件名1~13的复杂度由易到难排列。
在docker容器中安装的示例。 mongodb-org-shell ,包含mongo shell。 mongodb-org-tools ,包含以下MongoDB工具:mongoimport bsondump,mongodump,mongoexport,mongofiles,mongorestore,mongostat和mongotop。 ...
Shell示例和演示一个显示shell脚本示例的存储库。 目的是使用示例来演示壳如何表现和压缩一些假设。先决条件安装 为Shellcheck安装vscode扩展code --install-extension timonwong.shellcheck外壳帮助取决于运行的...
shell实现ftp命令示例,从服务器获取数据以及向服务器传递数据,本文给出了一种方法
shell短信接口开发_shell发送短信验证码通知_shell短信demo示例.docx
shell编程语句,语法、关键字,使用总结,每条注释详细,结合使用示例让你对shell编程更加熟练。
Shell等待的示例整理了一下本人硬盘里实用的编程资料和源码,全部是VB代码,希望大家能喜欢.
stm32F7系列shell示例,可以用SecureCRT输入输出,而不是用串口进行收发,非常实用,包含截图说明注意事项。
shell之demo示例+学习指南。Shell Script,Shell脚本与Windows/Dos下的批处理相似,也就是用各类命令预先放入到一个文件中,方便一次性执行的一个程序文件,主要是方便管理员进行设置或者管理用的
Linux Shell 实例精解Linux Shell 实例精解
本文讲述如何快速使用SQLite并在bcc/vc以及在shell中编程使用。
壳示例小BASH Shell脚本编写示例