linux tomcat shell脚本安装

#首先切换目录到home
cd /home
#创建software文件夹
makedir software
#下载tomcat
wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.32/bin/apache-tomcat-8.0.32.tar.gz
#unzip apache-tomcat-8.0.32.tar.gz
if [ -e /home/software/apache-tomcat-8.0.32.tar.gz ];
then
cd /home/software/
tar -zxf apache-tomcat-8.0.32.tar.gz -C /home
cd …
mv apache-tomcat-8.0.32 tomcat1
cd /home/tomcat1/conf
#修改tomcat server.xml配置文件第125行 docBase指定项目加载路径
sed -i '125i ’ server.xml
if [ $? -eq 0 ];
then
echo “–>[date +"%Y-%m-%d %H:%M.%S"] Successfully unzip apache-tomcat-8.0.32.tar.gz”
fi
else
echo “–>[date +"%Y-%m-%d %H:%M.%S"] the file apache-tomcat-8.0.32.tar.gz is not defind!!!”
fi

你可能感兴趣的:(linux,shell,tomcat,tomcat,linux,shell)