forked from ffffffff0x/f8x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
f8x-dev
177 lines (130 loc) · 4.81 KB
/
f8x-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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"