Network-Reinstall-System-Modify.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #!/bin/bash
  2. ## License: GPL
  3. ## This is the magically modified version of the one-click reload script.
  4. ## It can reinstall CentOS, Debian, Ubuntu and other Linux systems (continuously added) over the network in one click.
  5. ## It can reinstall Windwos 2003, 7, 2008R2, 2012R2, 2016, 2019 and other Windows systems (continuously added) via the network in one click.
  6. ## Support GRUB or GRUB2 for installing a clean minimal system.
  7. ## Technical support is provided by the CXT (CXTHHHHH.com). (based on the original version of Vicer)
  8. ## Magic Modify version author:
  9. ## Default root password: cxthhhhh.com
  10. ## WebSite: https://www.cxthhhhh.com
  11. ## Written By CXT (CXTHHHHH.com)
  12. ## Original version author:
  13. ## Blog: https://moeclub.org
  14. ## Written By Vicer (MoeClub.org)
  15. echo -e "\n\n\n"
  16. clear
  17. echo -e "\n"
  18. echo "---------------------------------------------------------------------------------------------------------------------"
  19. echo -e "\033[33m 一键网络重装系统 - 魔改版 版本:V3.2.0 更新:2021年04月15日 \033[0m"
  20. echo -e "\033[33m Network-Reinstall-System-Modify Tools V3.2.0 2021/04/15 \033[0m"
  21. echo "---------------------------------------------------------------------------------------------------------------------"
  22. echo -e "\033[33m 一键网络重装系统 - 魔改版(适用于Linux / Windows) \033[0m"
  23. echo -e "\033[33m 系统需求: 任何带有GRUB或GRUB2的Linux操作系统即可运行, 当前推荐安装的系统为: CentOS8/Debian10/Ubuntu20 \033[0m"
  24. echo -e "\n"
  25. echo -e "\033[33m [Magic Modify] Reinstall the system (any Windows / Linux) requires only network and one click \033[0m"
  26. echo -e "\033[33m System requirements: Any Linux system with GRUB or GRUB2, recommended CentOS8/Debian10/Ubuntu20 \033[0m"
  27. echo -e "\n"
  28. echo -e "\033[33m 官方更新地址(Official update address):CXT - Enjoy Life | 生活、技术、交友、分享 \033[0m"
  29. echo -e "\033[33m https://www.cxthhhhh.com/Network-Reinstall-System-Modify \033[0m"
  30. echo "---------------------------------------------------------------------------------------------------------------------"
  31. echo " 默认密码: cxthhhhh.com"
  32. echo " Default password: cxthhhhh.com"
  33. echo "---------------------------------------------------------------------------------------------------------------------"
  34. echo -e "\n"
  35. sleep 6s
  36. echo "---------------------------------------------------------------------------------------------------------------------"
  37. echo " 对当前系统环境进行处理. . ."
  38. echo " Pre-environment preparation. . ."
  39. echo "---------------------------------------------------------------------------------------------------------------------"
  40. echo -e "\n"
  41. sleep 2s
  42. if [ -f "/usr/bin/apt-get" ];then
  43. isDebian=`cat /etc/issue|grep Debian`
  44. if [ "$isDebian" != "" ];then
  45. echo '当前系统 是 Debian'
  46. echo 'Current system is Debian'
  47. apt-get install -y xz-utils openssl gawk file wget curl
  48. apt install -y xz-utils openssl gawk file wget curl
  49. sleep 3s
  50. else
  51. echo '当前系统 是 Ubuntu'
  52. echo 'Current system is Ubuntu'
  53. apt-get install -y xz-utils openssl gawk file wget curl
  54. apt install -y xz-utils openssl gawk file wget curl
  55. sleep 3s
  56. fi
  57. else
  58. echo '当前系统 是 CentOS'
  59. echo 'Current system is CentOS'
  60. yum install -y xz openssl gawk file wget curl
  61. sleep 3s
  62. fi
  63. echo "---------------------------------------------------------------------------------------------------------------------"
  64. echo " 对当前系统环境进行处理. . . 【OK】"
  65. echo " Pre-environment preparation. . . 【OK】"
  66. echo -e "\n"
  67. echo " 启动系统安装. . . "
  68. echo " Start system installation. . . "
  69. echo "---------------------------------------------------------------------------------------------------------------------"
  70. echo -e "\n"
  71. sleep 2s
  72. if [ $1 = '-UI_Options' ]
  73. then
  74. echo -e "\033[33m 你选择启动到 【图形化安装界面】 正在进入图形化安装选择器. . . \033[0m"
  75. echo -e "\033[33m You have chosen to Start the Graphical Interface Options, Wait a moment. . . \033[0m"
  76. echo -e "\n"
  77. sleep 1s
  78. 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
  79. fi
  80. if [ $1 = '-CXT_Bare-metal_System_Deployment_Platform' ]
  81. then
  82. echo -e "\033[33m 你选择安装 最新的 【CXT裸机系统部署平台】,支持玩家VNC自定义安装。(建议极客使用,小白勿扰) \033[0m"
  83. echo -e "\033[33m You have chosen to install the latest CXT_Bare-metal_System_Deployment_Platform \033[0m"
  84. echo -e "\n"
  85. sleep 5s
  86. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.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'
  87. fi
  88. if [ $1 = '-OpenWRT' ]
  89. then
  90. echo -e "\033[33m 你选择安装 最新的 【CXT-OpenWRT】 \033[0m"
  91. echo -e "\033[33m You have chosen to install the latest OpenWRT \033[0m"
  92. echo -e "\n"
  93. sleep 5s
  94. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/OpenWRT-Virtualization-Servers/Stable/openwrt-x86-64-generic-squashfs-combined.img.gz'
  95. fi
  96. if [ $1 = '-OpenWRT_UEFI' ]
  97. then
  98. echo -e "\033[33m 你选择安装 最新的 【CXT-OpenWRT】 支持UEFI启动模式 \033[0m"
  99. echo -e "\033[33m You have chosen to install the latest OpenWRT_UEFI \033[0m"
  100. echo -e "\n"
  101. sleep 5s
  102. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/OpenWRT-Virtualization-Servers/Stable/openwrt-x86-64-generic-squashfs-combined-efi.img.gz'
  103. fi
  104. if [ $1 = '-CentOS_8' ]
  105. then
  106. echo -e "\033[33m 你选择安装 最新的 【CentOS 8】 \033[0m"
  107. echo -e "\033[33m You have chosen to install the latest CentOS_8 \033[0m"
  108. echo -e "\n"
  109. sleep 5s
  110. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/CentOS/CentOS_8.X_NetInstallation_Stable_v3.6.vhd.gz'
  111. fi
  112. if [ $1 = '-CentOS_7' ]
  113. then
  114. echo -e "\033[33m 你选择安装 最新的 【CentOS 7】 \033[0m"
  115. echo -e "\033[33m You have chosen to install the latest CentOS_7 \033[0m"
  116. echo -e "\n"
  117. sleep 5s
  118. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/CentOS/CentOS_7.X_NetInstallation_Final_v9.2.vhd.gz'
  119. fi
  120. if [ $1 = '-Debian_10' ]
  121. then
  122. echo -e "\033[33m 你选择安装 最新的 【Debian 10】 \033[0m"
  123. echo -e "\033[33m You have chosen to install the latest Debian_10 \033[0m"
  124. echo -e "\n"
  125. sleep 5s
  126. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -d 10 -v 64 -a
  127. fi
  128. if [ $1 = '-Debian_9' ]
  129. then
  130. echo -e "\033[33m 你选择安装 最新的 【Debian 9】 \033[0m"
  131. echo -e "\033[33m You have chosen to install the latest Debian_9 \033[0m"
  132. echo -e "\n"
  133. sleep 5s
  134. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -d 9 -v 64 -a
  135. fi
  136. if [ $1 = '-Ubuntu_20.04' ]
  137. then
  138. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 20.04】 \033[0m"
  139. echo -e "\033[33m You have chosen to install the latest Ubuntu_20.04 \033[0m"
  140. echo -e "\n"
  141. sleep 5s
  142. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -u 20.04 -v 64 -a
  143. fi
  144. if [ $1 = '-Ubuntu_18.04' ]
  145. then
  146. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 18.04】 \033[0m"
  147. echo -e "\033[33m You have chosen to install the latest Ubuntu_18.04 \033[0m"
  148. echo -e "\n"
  149. sleep 5s
  150. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -u 18.04 -v 64 -a
  151. fi
  152. if [ $1 = '-Windows_Server_2019' ]
  153. then
  154. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2019】 \033[0m"
  155. echo -e "\033[33m You have chosen to install the latest Windows_Server_2019 \033[0m"
  156. echo -e "\n"
  157. sleep 5s
  158. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2019_DataCenter_CN_v5.1.vhd.gz'
  159. fi
  160. if [ $1 = '-Windows_Server_2019_UEFI' ]
  161. then
  162. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2019】 支持UEFI启动模式 \033[0m"
  163. echo -e "\033[33m You have chosen to install the latest Windows_Server_2019_UEFI \033[0m"
  164. echo -e "\n"
  165. sleep 5s
  166. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.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'
  167. fi
  168. if [ $1 = '-Windows_Server_2016' ]
  169. then
  170. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2016】 \033[0m"
  171. echo -e "\033[33m You have chosen to install the latest Windows_Server_2016 \033[0m"
  172. echo -e "\n"
  173. sleep 5s
  174. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2016_DataCenter_CN_v4.12.vhd.gz'
  175. fi
  176. if [ $1 = '-Windows_Server_2012R2' ]
  177. then
  178. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2012 R2】 \033[0m"
  179. echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2 \033[0m"
  180. echo -e "\n"
  181. sleep 5s
  182. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2012R2_DataCenter_CN_v4.29.vhd.gz'
  183. fi
  184. if [ $1 = '-Windows_Server_2012R2_UEFI' ]
  185. then
  186. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2012 R2】 支持UEFI启动模式 \033[0m"
  187. echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2_UEFI \033[0m"
  188. echo -e "\n"
  189. sleep 5s
  190. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.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'
  191. fi
  192. if [ $1 = '-DD' ]
  193. then
  194. echo -e "\033[33m 你选择安装 【由你指定的自定义镜像】 更多支持信息,你需要向镜像制作者寻求。 \033[0m"
  195. echo -e "\033[33m You have chosen to install the DD package provided by you \033[0m"
  196. echo -e "\n"
  197. sleep 5s
  198. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd $2
  199. fi
  200. if [ $1 = '-CentOS_6' ]
  201. then
  202. echo -e "\033[33m 你选择安装 最新的 【CentOS 6】(生命周期已结束,无任何支持) \033[0m"
  203. echo -e "\033[33m You have chosen to install the latest CentOS_6 (EOL, No supported) \033[0m"
  204. echo -e "\n"
  205. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  206. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  207. echo -e "\n"
  208. sleep 10s
  209. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -c 6.10 -v 64 -a
  210. fi
  211. if [ $1 = '-Debian_8' ]
  212. then
  213. echo -e "\033[33m 你选择安装 最新的 【Debian 8】(生命周期已结束,无任何支持) \033[0m"
  214. echo -e "\033[33m You have chosen to install the latest Debian_8 (EOL, No supported) \033[0m"
  215. echo -e "\n"
  216. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  217. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  218. echo -e "\n"
  219. sleep 10s
  220. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -d 8 -v 64 -a
  221. fi
  222. if [ $1 = '-Debian_7' ]
  223. then
  224. echo -e "\033[33m 你选择安装 最新的 【Debian 7】(生命周期已结束,无任何支持) \033[0m"
  225. echo -e "\033[33m You have chosen to install the latest Debian_7 (EOL, No supported) \033[0m"
  226. echo -e "\n"
  227. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  228. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  229. echo -e "\n"
  230. sleep 10s
  231. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -d 7 -v 64 -a
  232. fi
  233. if [ $1 = '-Ubuntu_16.04' ]
  234. then
  235. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 16.04】(生命周期已结束,无任何支持) \033[0m"
  236. echo -e "\033[33m You have chosen to install the latest Ubuntu_16.04 (EOL, No supported) \033[0m"
  237. echo -e "\n"
  238. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  239. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  240. echo -e "\n"
  241. sleep 10s
  242. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -u 16.04 -v 64 -a
  243. fi
  244. if [ $1 = '-Ubuntu_14.04' ]
  245. then
  246. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 14.04】(生命周期已结束,无任何支持) \033[0m"
  247. echo -e "\033[33m You have chosen to install the latest Ubuntu_14.04 (EOL, No supported) \033[0m"
  248. echo -e "\n"
  249. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  250. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  251. echo -e "\n"
  252. sleep 10s
  253. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -u 14.04 -v 64 -a
  254. fi
  255. if [ $1 = '-Windows_10_Lite' ]
  256. then
  257. echo -e "\033[33m 你选择安装 最新的 【Windows 10 Lite 精简版】(生命周期已结束,无任何支持) \033[0m"
  258. echo -e "\033[33m You have chosen to install the latest Windows_10_Lite (EOL, No supported) \033[0m"
  259. echo -e "\n"
  260. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  261. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  262. echo -e "\n"
  263. sleep 10s
  264. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.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'
  265. fi
  266. if [ $1 = '-Windows_Server_2008R2' ]
  267. then
  268. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2008R2】(生命周期已结束,无任何支持) \033[0m"
  269. echo -e "\033[33m You have chosen to install the latest Windows_Server_2008R2 (EOL, No supported) \033[0m"
  270. echo -e "\n"
  271. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  272. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  273. echo -e "\n"
  274. sleep 10s
  275. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2008R2_DataCenter_CN_v3.27.vhd.gz'
  276. fi
  277. if [ $1 = '-Windows_Server_2003R2' ]
  278. then
  279. echo -e "\033[33m 你选择安装 最新的 【Windows_Server_2003R2】(生命周期已结束,无任何支持) \033[0m"
  280. echo -e "\033[33m You have chosen to install the latest Windows_Server_2003R2 (EOL, No supported) \033[0m"
  281. echo -e "\n"
  282. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  283. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  284. echo -e "\n"
  285. sleep 10s
  286. wget --no-check-certificate -qO Core_Install.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/CoreShell/Core_Install_2020.sh' && bash Core_Install.sh -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disks/Disk_Windows_Server_2003_DataCenter_CN_v7.1.vhd.gz'
  287. fi
  288. echo "---------------------------------------------------------------------------------------------------------------------"
  289. echo -e "\033[35m Start Installation \033[0m"
  290. echo -e "\033[32m Start Installation \033[0m"
  291. echo "---------------------------------------------------------------------------------------------------------------------"
  292. echo -e "\n"
  293. exit