forked from MeowLove/Network-Reinstall-System-Modify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Network-Reinstall-System-Modify.sh
342 lines (298 loc) · 17.8 KB
/
Network-Reinstall-System-Modify.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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#!/bin/bash
## License: GPL
## This is the magically modified version of the one-click reload script.
## It can reinstall CentOS, Debian, Ubuntu and other Linux systems (continuously added) over the network in one click.
## It can reinstall Windwos 2003, 7, 2008R2, 2012R2, 2016, 2019 and other Windows systems (continuously added) via the network in one click.
## Support GRUB or GRUB2 for installing a clean minimal system.
## Technical support is provided by the CXT (CXTHHHHH.com). (based on the original version of Vicer)
## Magic Modify version author:
## Default root password: cxthhhhh.com
## WebSite: https://www.cxthhhhh.com
## Written By CXT (CXTHHHHH.com)
## Original version author:
## Blog: https://moeclub.org
## Written By Vicer (MoeClub.org)
echo -e "\n\n\n"
clear
echo -e "\n"
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\033[33m 一键网络重装系统 - 魔改版 版本:V4.1.0 更新:2021年04月16日 \033[0m"
echo -e "\033[33m Network-Reinstall-System-Modify Tools V4.1.0 2021/04/16 \033[0m"
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\033[33m 一键网络重装系统 - 魔改版(适用于Linux / Windows) \033[0m"
echo -e "\033[33m 系统需求: 任何带有GRUB或GRUB2的Linux操作系统即可运行, 当前推荐安装的系统为: CentOS8/Debian10/Ubuntu20 \033[0m"
echo -e "\n"
echo -e "\033[33m [Magic Modify] Reinstall the system (any Windows / Linux) requires only network and one click \033[0m"
echo -e "\033[33m System requirements: Any Linux system with GRUB or GRUB2, recommended CentOS8/Debian10/Ubuntu20 \033[0m"
echo -e "\n"
echo -e "\033[33m 官方更新地址(Official update address):CXT - Enjoy Life | 生活、技术、交友、分享 \033[0m"
echo -e "\033[33m https://www.cxthhhhh.com/Network-Reinstall-System-Modify \033[0m"
echo "---------------------------------------------------------------------------------------------------------------------"
echo " 默认密码: cxthhhhh.com"
echo " Default password: cxthhhhh.com"
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\n"
sleep 6s
echo "---------------------------------------------------------------------------------------------------------------------"
echo " 对当前系统环境进行处理. . ."
echo " Pre-environment preparation. . ."
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\n"
sleep 2s
if [ -f "/usr/bin/apt-get" ];then
isDebian=`cat /etc/issue|grep Debian`
if [ "$isDebian" != "" ];then
echo '当前系统 是 Debian'
echo 'Current system is Debian'
apt-get install -y xz-utils openssl gawk file wget curl
apt install -y xz-utils openssl gawk file wget curl
sleep 3s
else
echo '当前系统 是 Ubuntu'
echo 'Current system is Ubuntu'
apt-get install -y xz-utils openssl gawk file wget curl
apt install -y xz-utils openssl gawk file wget curl
sleep 3s
fi
else
echo '当前系统 是 CentOS'
echo 'Current system is CentOS'
yum install -y xz openssl gawk file wget curl
sleep 3s
fi
echo "---------------------------------------------------------------------------------------------------------------------"
echo " 对当前系统环境进行处理. . . 【OK】"
echo " Pre-environment preparation. . . 【OK】"
echo -e "\n"
echo " 启动系统安装. . . "
echo " Start system installation. . . "
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\n"
sleep 2s
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\033[35m 启动 安装 \033[0m"
echo -e "\033[32m Start Installation \033[0m"
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\n"
if [ $1 = '-UI_Options' ]
then
echo -e "\033[33m 你选择启动到 【图形化安装界面】 正在进入图形化安装选择器. . . \033[0m"
echo -e "\033[33m You have chosen to Start the Graphical Interface Options, Wait a moment. . . \033[0m"
echo -e "\n"
sleep 1s
wget --no-check-certificate -qO UI_Options.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/UI_Options.sh' && bash UI_Options.sh
fi
if [ $1 = '-CXT_Bare-metal_System_Deployment_Platform' ]
then
echo -e "\033[33m 你选择安装 最新的 【CXT裸机系统部署平台】,支持玩家VNC自定义安装。(建议极客使用,小白勿扰) \033[0m"
echo -e "\033[33m You have chosen to install the latest CXT_Bare-metal_System_Deployment_Platform \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Bare-metal_System_Deployment_Platform/CXT_Bare-metal_System_Deployment_Platform_v3.6.vhd.gz'
fi
if [ $1 = '-OpenWRT' ]
then
echo -e "\033[33m 你选择安装 最新的 【CXT-OpenWRT】 \033[0m"
echo -e "\033[33m You have chosen to install the latest OpenWRT \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/OpenWRT-Virtualization-Servers/Stable/openwrt-x86-64-generic-squashfs-combined.img.gz'
fi
if [ $1 = '-OpenWRT_UEFI' ]
then
echo -e "\033[33m 你选择安装 最新的 【CXT-OpenWRT】 支持UEFI启动模式 \033[0m"
echo -e "\033[33m You have chosen to install the latest OpenWRT_UEFI \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/OpenWRT-Virtualization-Servers/Stable/openwrt-x86-64-generic-squashfs-combined-efi.img.gz'
fi
if [ $1 = '-CentOS_8' ]
then
echo -e "\033[33m 你选择安装 最新的 【CentOS 8】 \033[0m"
echo -e "\033[33m You have chosen to install the latest CentOS_8 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/CentOS/CentOS_8.X_NetInstallation_Stable_v3.6.vhd.gz'
fi
if [ $1 = '-CentOS_7' ]
then
echo -e "\033[33m 你选择安装 最新的 【CentOS 7】 \033[0m"
echo -e "\033[33m You have chosen to install the latest CentOS_7 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/CentOS/CentOS_7.X_NetInstallation_Final_v9.2.vhd.gz'
fi
if [ $1 = '-Debian_10' ]
then
echo -e "\033[33m 你选择安装 最新的 【Debian 10】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Debian_10 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -d 10 -v 64 -a
fi
if [ $1 = '-Debian_9' ]
then
echo -e "\033[33m 你选择安装 最新的 【Debian 9】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Debian_9 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -d 9 -v 64 -a
fi
if [ $1 = '-Ubuntu_20.04' ]
then
echo -e "\033[33m 你选择安装 最新的 【Ubuntu 20.04】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Ubuntu_20.04 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -u 20.04 -v 64 -a
fi
if [ $1 = '-Ubuntu_18.04' ]
then
echo -e "\033[33m 你选择安装 最新的 【Ubuntu 18.04】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Ubuntu_18.04 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -u 18.04 -v 64 -a
fi
if [ $1 = '-Windows_Server_2019' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows Server 2019】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2019 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2019_DataCenter_CN_v5.1.vhd.gz'
fi
if [ $1 = '-Windows_Server_2019_UEFI' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows Server 2019】 支持UEFI启动模式 \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2019_UEFI \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2019_DataCenter_CN_v5.1_UEFI.vhd.gz'
fi
if [ $1 = '-Windows_Server_2016' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows Server 2016】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2016 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2016_DataCenter_CN_v4.12.vhd.gz'
fi
if [ $1 = '-Windows_Server_2012R2' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows Server 2012 R2】 \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2 \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2012R2_DataCenter_CN_v4.29.vhd.gz'
fi
if [ $1 = '-Windows_Server_2012R2_UEFI' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows Server 2012 R2】 支持UEFI启动模式 \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2_UEFI \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2012R2_DataCenter_CN_v4.29_UEFI.vhd.gz'
fi
if [ $1 = '-DD' ]
then
echo -e "\033[33m 你选择安装 【由你指定的自定义镜像】 更多支持信息,你需要向镜像制作者寻求。 \033[0m"
echo -e "\033[33m You have chosen to install the DD package provided by you \033[0m"
echo -e "\n"
sleep 5s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd $2
fi
if [ $1 = '-CentOS_6' ]
then
echo -e "\033[33m 你选择安装 最新的 【CentOS 6】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest CentOS_6 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -c 6.10 -v 64 -a
fi
if [ $1 = '-Debian_8' ]
then
echo -e "\033[33m 你选择安装 最新的 【Debian 8】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Debian_8 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -d 8 -v 64 -a
fi
if [ $1 = '-Debian_7' ]
then
echo -e "\033[33m 你选择安装 最新的 【Debian 7】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Debian_7 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -d 7 -v 64 -a
fi
if [ $1 = '-Ubuntu_16.04' ]
then
echo -e "\033[33m 你选择安装 最新的 【Ubuntu 16.04】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Ubuntu_16.04 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -u 16.04 -v 64 -a
fi
if [ $1 = '-Ubuntu_14.04' ]
then
echo -e "\033[33m 你选择安装 最新的 【Ubuntu 14.04】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Ubuntu_14.04 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -u 14.04 -v 64 -a
fi
if [ $1 = '-Windows_10_Lite' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows 10 Lite 精简版】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_10_Lite (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Historical_File_Windows_DD_Disk/Disk_Windows_10_x64_Lite_by_CXT_v1.0.vhd.gz'
fi
if [ $1 = '-Windows_Server_2008R2' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows Server 2008R2】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2008R2 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2008R2_DataCenter_CN_v3.27.vhd.gz'
fi
if [ $1 = '-Windows_Server_2003R2' ]
then
echo -e "\033[33m 你选择安装 最新的 【Windows_Server_2003R2】(生命周期已结束,无任何支持) \033[0m"
echo -e "\033[33m You have chosen to install the latest Windows_Server_2003R2 (EOL, No supported) \033[0m"
echo -e "\n"
echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
echo -e "\n"
sleep 10s
wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_v3.1.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2003_DataCenter_CN_v7.1.vhd.gz'
fi
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\033[35m 启动 安装 \033[0m"
echo -e "\033[32m Start Installation \033[0m"
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\n"
exit