File tree Expand file tree Collapse file tree 1 file changed +38
-5
lines changed
Expand file tree Collapse file tree 1 file changed +38
-5
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ version=9.0.34
4+
35tomcat (){
6+ tomcat_uninstall
47 echo " 安装tomcat 之前必须安装 JDK"
58 cd /usr/local/src
69
710 echo " 正在下载 tomcat 安装包,请稍等..."
8- wget -N --no-check-certificate https://gclm.coding.net/p/java/d/java/git/raw/master/apache-tomcat-9.0.34 .tar.gz
11+ wget -N --no-check-certificate https://gclm.coding.net/p/java/d/java/git/raw/master/apache-tomcat-${version} .tar.gz
912
1013 echo " 开始安装 tomcat "
11- tar -zxvf apache-tomcat-9.0.34 .tar.gz
12- mv apache-tomcat-9.0.34 /usr/local/tomcat
14+ tar -zxvf apache-tomcat-${version} .tar.gz
15+ mv apache-tomcat-${version} /usr/local/tomcat
1316 rm -rf /usr/local/src/apache-tomcat-*
1417
1518 clear
@@ -24,8 +27,38 @@ tomcat_uninstall(){
2427}
2528
2629main (){
27- tomcat_uninstall
28- tomcat
30+ clear
31+ echo -e "
32+ ———————————— 开发环境(Java) ————————————
33+ 1.${Font_color_suffix} 安装 Tomcat7
34+ 2.${Font_color_suffix} 安装 Tomcat8
35+ 3.${Font_color_suffix} 安装 Tomcat9
36+ 0.${Font_color_suffix} 退出脚本
37+ ——————————————————————————————————————" && echo
38+ read -p " 请输入选项 :" num
39+ case " $num " in
40+ 0)
41+ exit 1
42+ ;;
43+ 1)
44+ version=7.0.100
45+ tomcat
46+ ;;
47+ 2)
48+ version=8.5.53
49+ tomcat
50+ ;;
51+ 3)
52+ version=9.0.34
53+ tomcat
54+ ;;
55+ * )
56+ clear
57+ echo -e " ${Error} :请输入正确选项:"
58+ sleep 3s
59+ main
60+ ;;
61+ esac
2962}
3063
3164main
You can’t perform that action at this time.
0 commit comments