diff --git a/README.md b/README.md index 47b76c53..18cb4c66 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,11 @@ bash f8x -h f8x 基本上不需要任何依赖,或者说它就是为了帮助你安装各种依赖而生的😁 +**f8x-dev** + +部分开发环境安装独立到该脚本 +- wget : `wget -O f8x https://f8x.io/dev` + --- ## 支持选项 diff --git a/f8x-dev b/f8x-dev new file mode 100644 index 00000000..aed41039 --- /dev/null +++ b/f8x-dev @@ -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"