This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
/
toolbox.sh
208 lines (183 loc) · 5.8 KB
/
toolbox.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#!/bin/bash
# 一些全局变量
ver="1.4"
changeLog="添加修改主机名,以及修改一些小问题"
green(){
echo -e "\033[32m\033[01m$1\033[0m"
}
red(){
echo -e "\033[31m\033[01m$1\033[0m"
}
yellow(){
echo -e "\033[33m\033[01m$1\033[0m"
}
if [[ -f /etc/redhat-release ]]; then
release="Centos"
elif cat /etc/issue | grep -q -E -i "debian"; then
release="Debian"
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
release="Ubuntu"
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
release="Centos"
elif cat /proc/version | grep -q -E -i "debian"; then
release="Debian"
elif cat /proc/version | grep -q -E -i "ubuntu"; then
release="Ubuntu"
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
release="Centos"
else
red "不支持你当前系统,请使用Ubuntu,Debian,Centos系统"
rm -f toolbox.sh
exit 1
fi
if ! type curl >/dev/null 2>&1; then
yellow "检测到curl未安装,安装中 "
if [ $release = "Centos" ]; then
yum -y update && yum install curl -y
else
apt-get update -y && apt-get install curl -y
fi
else
green "curl已安装"
fi
if ! type wget >/dev/null 2>&1; then
yellow "检测到wget未安装,安装中 "
if [ $release = "Centos" ]; then
yum -y update && yum install wget -y
else
apt-get update -y && apt-get install wget -y
fi
else
green "wget已安装"
fi
if ! type sudo >/dev/null 2>&1; then
yellow "检测到sudo未安装,安装中 "
if [ $release = "Centos" ]; then
yum -y update && yum install sudo -y
else
apt-get update -y && apt-get install sudo -y
fi
else
green "sudo已安装"
fi
function rootLogin(){
wget -N https://cdn.jsdelivr.net/gh/Misaka-blog/rootLogin@master/root.sh && chmod -R 777 root.sh && bash root.sh
}
function warp(){
wget -N https://cdn.jsdelivr.net/gh/fscarmen/warp/menu.sh && bash menu.sh
}
function xui(){
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
}
function macka(){
wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
}
function bbr(){
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
}
function bthappy(){
echo " "
echo "请选择你需要安装的版本"
echo "1. 专业版"
echo "2. 企业版"
echo "0. 返回主页"
read -p "请输入选项的数字:" menuNumberInput1
case "$menuNumberInput1" in
1 ) bthappypro;;
2 ) bthappyent;;
0 ) start_menu;;
esac
}
function bthappyent(){
if [ $release = "Centos" ]; then
yum install -y wget && wget -O install.sh http://download.moetas.com/ltd/install/install_6.0.sh && sh install.sh
elif [ $release = "Debian" ]; then
wget -O install.sh http://download.moetas.com/ltd/install/install-ubuntu_6.0.sh && bash install.sh
else
wget -O install.sh http://download.moetas.com/ltd/install/install-ubuntu_6.0.sh && sudo bash install.sh
fi
}
function bthappypro(){
if [ $release = "Centos" ]; then
yum install -y wget && wget -O install.sh http://download.moetas.com/install/install_6.0.sh && sh install.sh
elif [ $release = "Debian" ]; then
wget -O install.sh http://download.moetas.com/install/install-ubuntu_6.0.sh && bash install.sh
else
wget -O install.sh http://download.moetas.com/install/install-ubuntu_6.0.sh && sudo bash install.sh
fi
}
function docker(){
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
}
function mediaUnblockTest(){
bash <(curl -sSL "https://github.com/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")
}
function vpsSpeedTest(){
bash <(curl -sSL "https://github.com/CoiaPrant/Speedtest/raw/main/speedtest-multi.sh")
}
function serverstatus(){
wget -N https://raw.githubusercontent.com/cokemine/ServerStatus-Hotaru/master/status.sh
echo "请选择你需要安装的客户端类型"
echo "1. 服务端"
echo "2. 监控端"
echo "0. 返回主页"
read -p "请输入选项的数字:" menuNumberInput1
case "$menuNumberInput1" in
1 ) serverstatusServer;;
2 ) serverstatusClient;;
0 ) start_menu;;
esac
}
function serverstatusServer(){
bash status.sh s
}
function serverstatusClient(){
bash status.sh c
}
function changehostname(){
read -p "您的新主机名:" newhostname
hostnamectl set-hostname $newhostname
green "修改完成,请重新连接ssh或重新启动服务器!"
}
function start_menu(){
clear
red "============================"
red " "
red " Misaka Linux Toolbox "
echo " "
red " https://blog.misaka.rest "
echo " "
red "============================"
echo " "
green "检测到您当前运行的工具箱版本是:$ver"
green "更新日志:$changeLog"
echo " "
echo "下面是我们提供的一些功能"
echo "1. VPS修改登录方式为root密码登录"
echo "2. VPS安装warp"
echo "3. X-ui面板安装"
echo "4. Mack-a 节点配置脚本"
echo "5. 一键开启BBR"
echo "6. 安装宝塔开心版"
echo "7. 一键安装docker"
echo "8. 流媒体解锁测试"
echo "9. VPS三网测速"
echo "10. 修改主机名"
echo "0. 退出脚本"
echo " "
read -p "请输入选项的数字:" menuNumberInput
case "$menuNumberInput" in
1 ) rootLogin;;
2 ) warp;;
3 ) xui ;;
4 ) macka ;;
5 ) bbr ;;
6 ) bthappy ;;
7 ) docker ;;
8 ) mediaUnblockTest ;;
9 ) vpsSpeedTest ;;
10 ) changehostname ;;
0 ) exit 0;;
esac
}
start_menu