-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10.sh
275 lines (244 loc) · 8.32 KB
/
10.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#!/bin/bash
# 一些全局变量
ver="1.4.5"
changeLog="新增禁用Oracle系统自带防火墙、Acme.sh和Screen后台任务管理脚本"
arch=`uname -m`
virt=`systemd-detect-virt`
kernelVer=`uname -r`
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 MisakaToolbox.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 hijk(){
bash <(curl -sL https://raw.githubusercontent.com/Misaka-blog/hijk-backup/master/xray.sh)
}
function tgMTProxy(){
mkdir /home/mtproxy && cd /home/mtproxy
curl -s -o mtproxy.sh https://raw.githubusercontent.com/sunpma/mtp/master/mtproxy.sh && chmod +x mtproxy.sh && bash mtproxy.sh
bash mtproxy.sh start
}
function acme1key(){
wget -N https://cdn.jsdelivr.net/gh/Misaka-blog/acme1key@master/acme1key.sh && chmod -R 777 acme1key.sh && bash acme1key.sh
}
function screenManager(){
wget -N https://cdn.jsdelivr.net/gh/Misaka-blog/screenManager@master/screen.sh && chmod -R 777 screen.sh && bash screen.sh
}
function oraclefirewall(){
if [ $release = "Centos" ]; then
systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater
systemctl stop firewalld.service
systemctl disable firewalld.service
else
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
apt-get purge netfilter-persistent -y
fi
}
function updateScript(){
wget -N https://raw.githubusercontent.com/Misaka-blog/MisakaLinuxToolbox/master/MisakaToolbox.sh && chmod -R 777 MisakaToolbox.sh && bash MisakaToolbox.sh
}
function start_menu(){
clear
red "============================"
red " "
red " Misaka Linux Toolbox "
echo " "
red " https://blog.misaka.rest "
echo " "
red "============================"
echo " "
green "检测到您当前运行的工具箱版本是:$ver"
green "更新日志:$changeLog"
echo " "
yellow "检测到VPS信息如下"
yellow "处理器架构:$arch"
yellow "虚拟化架构:$virt"
yellow "操作系统:$release"
yellow "内核版本:$kernelVer"
echo " "
green "下面是工具箱提供的一些功能"
echo " "
echo "1. VPS修改登录方式为root密码登录"
echo "2. VPS安装warp"
echo "3. X-ui面板安装"
echo "4. Mack-a 节点配置脚本"
echo " "
echo "5. 一键开启BBR"
echo "6. 安装宝塔开心版"
echo "7. 一键安装docker"
echo "8. 流媒体解锁测试"
echo " "
echo "9. VPS三网测速"
echo "10. 修改主机名"
echo "11. 安装可乐大佬的ServerStatus-Horatu探针"
echo "12. hijk大佬的v2脚本,支持IBM LinuxONE s390x的机器搭建节点"
echo " "
echo "13. 一键安装 Telegram MTProxy 代理服务器"
echo "14. Acme.sh 证书申请脚本"
echo "15. Screen 后台运行管理脚本"
echo "16. 禁用Oracle(甲骨文)系统自带防火墙"
echo " "
echo "v. 更新脚本"
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 ;;
11 ) serverstatus ;;
12 ) hijk ;;
13 ) tgMTProxy ;;
14 ) acme1key ;;
15 ) screenManager ;;
16 ) oraclefirewall ;;
v ) updateScript ;;
0 ) exit 0;;
esac
}
start_menu