-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.sh
188 lines (168 loc) · 4.43 KB
/
main.sh
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
178
179
180
181
182
183
184
185
186
187
188
#! /bin/bash
# By WJQSERVER-STUDIO_WJQSERVER
#https://github.com/WJQSERVER/tools-stable
# 导入配置文件
source "repo_url.conf"
# 获取当前版本并设置5秒超时
version=$(curl -s --max-time 3 ${repo_url}Version)
if [ $? -ne 0 ]; then
version="unknown" # 设置默认值或进行其他错误处理
fi
# 获取统计信息并设置5秒超时
total=$(curl -s --max-time 3 https://count.1888866.xyz/api/counter/total)
if [ $? -ne 0 ]; then
total="unknown" # 设置默认值或进行其他错误处理
fi
today=$(curl -s --max-time 3 https://count.1888866.xyz/api/counter/daily)
if [ $? -ne 0 ]; then
today="unknown"
fi
# 统计次数
response=$(curl -s --max-time 3 https://count.1888866.xyz/add)
if [ $? -ne 0 ]; then
echo
else
echo
fi
mikublue="\033[38;2;57;197;187m"
yellow='\033[33m'
white='\033[0m'
green='\033[0;32m'
blue='\033[0;34m'
red='\033[31m'
gray='\e[37m'
#彩色
mikublue(){
echo -e "\033[38;2;57;197;187m\033[01m$1\033[0m"
}
white(){
echo -e "\033[0m\033[01m$1\033[0m"
}
red(){
echo -e "\033[31m\033[01m$1\033[0m"
}
green(){
echo -e "\033[32m\033[01m$1\033[0m"
}
yellow(){
echo -e "\033[33m\033[01m$1\033[0m"
}
blue(){
echo -e "\033[34m\033[01m$1\033[0m"
}
gray(){
echo -e "\e[37m\033[01m$1\033[0m"
}
option(){
echo -e "\033[32m\033[01m ${1}. \033[38;2;57;197;187m${2}\033[0m"
}
#系统信息
function sysinfo(){
wget -O sysinfo.sh ${repo_url}systools/sysinfo.sh && chmod +x sysinfo.sh && ./sysinfo.sh
}
#docker管理
function docker-manager(){
wget -O docker-manager-menu.sh ${repo_url}docker-manager/docker-manager-menu.sh && chmod +x docker-manager-menu.sh && ./docker-manager-menu.sh
}
#系统工具菜单
function systools(){
wget -O systools-menu.sh ${repo_url}systools/systools-menu.sh && chmod +x systools-menu.sh && ./systools-menu.sh
}
#面板部署菜单
function panel(){
wget -O panel-menu.sh ${repo_url}panel/panel-menu.sh && chmod +x panel-menu.sh && ./panel-menu.sh
}
#项目部署菜单
function program(){
wget -O program-menu.sh ${repo_url}program/program-menu.sh && chmod +x program-menu.sh && ./program-menu.sh
}
#测试工具菜单
function test-tool(){
wget -O test-menu.sh ${repo_url}Test/test-menu.sh && chmod +x test-menu.sh && ./test-menu.sh
}
#网站部署菜单
function web(){
wget -O web-menu.sh ${repo_url}web/web-menu.sh && chmod +x web-menu.sh && ./web-menu.sh
}
#环境部署
function environment(){
wget -O environment-menu.sh ${repo_url}environment/environment-menu.sh && chmod +x environment-menu.sh && ./environment-menu.sh
}
#更多脚本
#function bash(){
# wget -O bashmenu.sh ${repo_url}bash/bashmenu.sh && chmod +x bashmenu.sh && ./bashmenu.sh
#}
#PVE管理
function pve(){
wget -O pve_menu.sh ${repo_url}pve/pve_menu.sh && chmod +x pve_menu.sh && ./pve_menu.sh
}
#代理节点管理
function proxy(){
wget -O proxy-menu.sh ${repo_url}proxy/proxy-menu.sh && chmod +x proxy-menu.sh && ./proxy-menu.sh
}
#主菜单
function start_menu(){
clear
red " WJQserver Studio Linux工具箱"
yellow " FROM: https://github.com/WJQSERVER-STUDIO/tools-stable "
mikublue " 当前版本: ${gray}v.${version}"
mikublue " 脚本已运行 ${total} 次,今日运行 ${today} 次"
green " =================================================="
option 1 "系统信息查看"
option 2 "Docker管理"
option 3 "系统工具"
option 4 "面板部署"
option 5 "项目部署"
option 6 "测试工具"
option 7 "网站部署"
option 8 "环境部署"
green " =================================================="
option 9 "PVE管理"
green " =================================================="
option 10 "代理部署"
green " =================================================="
option 0 "退出脚本"
echo
read -p " 请输入数字:" menuNumberInput
case "$menuNumberInput" in
1 )
sysinfo
;;
2 )
docker-manager
;;
3 )
systools
;;
4 )
panel
;;
5 )
program
;;
6 )
test-tool
;;
7 )
web
;;
8 )
environment
;;
9 )
pve
;;
10 )
proxy
;;
0 )
exit 1
;;
* )
clear
red "请输入正确数字 !"
start_menu
;;
esac
}
start_menu "first"