-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ===================== 基础变量设置 ===================== | ||
|
||
export GitPorxy="https://github.ffffffff0x.com/" | ||
export GitPorxy2="https://cdn.ffffffff0x.com/?durl=" | ||
|
||
if test -e /usr/local/bin/f8x | ||
then | ||
sleep 0.001 | ||
else | ||
curl -o f8x https://f8x.io/ && mv --force f8x /usr/local/bin/f8x && chmod +x /usr/local/bin/f8x && echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;32m[INFOR]\033[0m - \033[1;32m已安装 f8x 工具\033[0m" || echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;31m[ERROR]\033[0m - \033[1;31mf8x 安装失败\n\033[0m" | ||
fi | ||
|
||
. /usr/local/bin/f8x | ||
|
||
# ===================== 软件版本变量设置 ===================== | ||
|
||
tomcat6_bin="apache-tomcat-6.0.53.tar.gz" | ||
tomcat6_dir="apache-tomcat-6.0.53" | ||
tomcat7_bin="apache-tomcat-7.0.109.tar.gz" | ||
tomcat7_dir="apache-tomcat-7.0.109" | ||
tomcat8_bin="apache-tomcat-8.5.68.tar.gz" | ||
tomcat8_dir="apache-tomcat-8.5.68" | ||
tomcat9_bin="apache-tomcat-9.0.50.tar.gz" | ||
tomcat9_dir="apache-tomcat-9.0.50" | ||
|
||
Main | ||
Base_Dir | ||
Pentest_Base_Install > /dev/null 2>&1 | ||
|
||
# ===================== 部署 tomcat6 ===================== | ||
|
||
tomcat6_Install(){ | ||
|
||
# Tomcat 6.0 requires JRE 5.0 or later. | ||
|
||
name="tomcat6" | ||
dir="/usr/local/$tomcat6_dir" | ||
|
||
if test -d $dir | ||
then | ||
Echo_ALERT "$name 已下载在 $dir" | ||
else | ||
cd $T_Dir && rm -rf $tomcat6_bin && wget https://archive.apache.org/dist/tomcat/tomcat-6/v6.0.53/bin/$tomcat6_bin | ||
tar -zxf $tomcat6_bin -C /usr/local/ && rm -rf $tomcat6_bin | ||
|
||
fi | ||
|
||
rm -rf /usr/local/tomcat | ||
ln -s /usr/local/${tomcat6_dir}/ /usr/local/tomcat | ||
Echo_INFOR "手动运行以下命令:\nexport CATALINA_HOME=/usr/local/tomcat\nexport PATH=\$CATALINA_HOME/bin:\$PATH" | ||
|
||
# catalina.sh version | ||
# catalina.sh start | ||
|
||
} | ||
|
||
# ===================== 部署 tomcat7 ===================== | ||
|
||
tomcat7_Install(){ | ||
|
||
# Tomcat 7.0 requires Java 6 or later. | ||
|
||
name="tomcat7" | ||
dir="/usr/local/$tomcat7_dir" | ||
|
||
if test -d $dir | ||
then | ||
Echo_ALERT "$name 已下载在 $dir" | ||
else | ||
cd $T_Dir && rm -rf $tomcat7_bin && wget https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.109/bin/$tomcat7_bin | ||
tar -zxf $tomcat7_bin -C /usr/local/ && rm -rf $tomcat7_bin | ||
fi | ||
|
||
rm -rf /usr/local/tomcat | ||
ln -s /usr/local/${tomcat7_dir}/ /usr/local/tomcat | ||
Echo_INFOR "手动运行以下命令:\nexport CATALINA_HOME=/usr/local/tomcat\nexport PATH=\$CATALINA_HOME/bin:\$PATH" | ||
|
||
# catalina.sh version | ||
# catalina.sh start | ||
|
||
} | ||
|
||
# ===================== 部署 tomcat8 ===================== | ||
|
||
tomcat8_Install(){ | ||
|
||
# Tomcat 8.5 requires Java 7 or later. | ||
|
||
name="tomcat8" | ||
dir="/usr/local/$tomcat8_dir" | ||
|
||
if test -d $dir | ||
then | ||
Echo_ALERT "$name 已下载在 $dir" | ||
else | ||
cd $T_Dir && rm -rf $tomcat8_bin && wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.68/bin/$tomcat8_bin | ||
tar -zxf $tomcat8_bin -C /usr/local/ && rm -rf $tomcat8_bin | ||
|
||
fi | ||
|
||
rm -rf /usr/local/tomcat | ||
ln -s /usr/local/${tomcat8_dir}/ /usr/local/tomcat | ||
Echo_INFOR "手动运行以下命令:\nexport CATALINA_HOME=/usr/local/tomcat\nexport PATH=\$CATALINA_HOME/bin:\$PATH" | ||
|
||
# catalina.sh version | ||
# catalina.sh start | ||
|
||
} | ||
|
||
# ===================== 部署 tomcat9 ===================== | ||
|
||
tomcat9_Install(){ | ||
|
||
# Tomcat 9.0 requires Java 8 or later. | ||
|
||
name="tomcat9" | ||
dir="/usr/local/$tomcat9_dir" | ||
|
||
if test -d $dir | ||
then | ||
Echo_ALERT "$name 已下载在 $dir" | ||
else | ||
cd $T_Dir && rm -rf $tomcat9_bin && wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.50/bin/ | ||
tar -zxf $tomcat9_bin -C /usr/local/ && rm -rf $tomcat9_bin | ||
|
||
fi | ||
|
||
rm -rf /usr/local/tomcat | ||
ln -s /usr/local/${tomcat9_dir}/ /usr/local/tomcat | ||
Echo_INFOR "手动运行以下命令:\nexport CATALINA_HOME=/usr/local/tomcat\nexport PATH=\$CATALINA_HOME/bin:\$PATH" | ||
|
||
# catalina.sh version | ||
# catalina.sh start | ||
|
||
} | ||
|
||
Help_Info(){ | ||
|
||
echo -e "\033[1;34m1. tomcat 安装 \033[0m" | ||
echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-tomcat6\033[0m \033[0;34m安装 tomcat6 环境 \033[0m" | ||
echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-tomcat7\033[0m \033[0;34m安装 tomcat7 环境 \033[0m" | ||
echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-tomcat8\033[0m \033[0;34m安装 tomcat8 环境 \033[0m" | ||
echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-tomcat9\033[0m \033[0;34m安装 tomcat9 环境 \033[0m" | ||
|
||
} | ||
|
||
case "$1" in | ||
-tomcat6) | ||
Porxy_Switch | ||
Base_Check | ||
tomcat6_Install | ||
;; | ||
-tomcat7) | ||
Porxy_Switch | ||
Base_Check | ||
tomcat7_Install | ||
;; | ||
-tomcat8) | ||
Porxy_Switch | ||
Base_Check | ||
tomcat8_Install | ||
;; | ||
-tomcat9) | ||
Porxy_Switch | ||
Base_Check | ||
tomcat9_Install | ||
;; | ||
-help | help) | ||
printf "\033c" | ||
Help_Info | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo -e "\033[1;36m \n-----OVER-----\n \033[0m" |