Network-Reinstall-System-Modify.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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 一键网络重装系统 - 魔改版 版本:V4.1.0 更新:2021年04月16日 \033[0m"
  20. echo -e "\033[33m Network-Reinstall-System-Modify Tools V4.1.0 2021/04/16 \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. echo "---------------------------------------------------------------------------------------------------------------------"
  73. echo -e "\033[35m 启动 安装 \033[0m"
  74. echo -e "\033[32m Start Installation \033[0m"
  75. echo "---------------------------------------------------------------------------------------------------------------------"
  76. echo -e "\n"
  77. if [ $1 = '-UI_Options' ]
  78. then
  79. echo -e "\033[33m 你选择启动到 【图形化安装界面】 正在进入图形化安装选择器. . . \033[0m"
  80. echo -e "\033[33m You have chosen to Start the Graphical Interface Options, Wait a moment. . . \033[0m"
  81. echo -e "\n"
  82. sleep 1s
  83. 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
  84. fi
  85. if [ $1 = '-CXT_Bare-metal_System_Deployment_Platform' ]
  86. then
  87. echo -e "\033[33m 你选择安装 最新的 【CXT裸机系统部署平台】,支持玩家VNC自定义安装。(建议极客使用,小白勿扰) \033[0m"
  88. echo -e "\033[33m You have chosen to install the latest CXT_Bare-metal_System_Deployment_Platform \033[0m"
  89. echo -e "\n"
  90. sleep 5s
  91. 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'
  92. fi
  93. if [ $1 = '-OpenWRT' ]
  94. then
  95. echo -e "\033[33m 你选择安装 最新的 【CXT-OpenWRT】 \033[0m"
  96. echo -e "\033[33m You have chosen to install the latest OpenWRT \033[0m"
  97. echo -e "\n"
  98. sleep 5s
  99. 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'
  100. fi
  101. if [ $1 = '-OpenWRT_UEFI' ]
  102. then
  103. echo -e "\033[33m 你选择安装 最新的 【CXT-OpenWRT】 支持UEFI启动模式 \033[0m"
  104. echo -e "\033[33m You have chosen to install the latest OpenWRT_UEFI \033[0m"
  105. echo -e "\n"
  106. sleep 5s
  107. 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'
  108. fi
  109. if [ $1 = '-CentOS_8' ]
  110. then
  111. echo -e "\033[33m 你选择安装 最新的 【CentOS 8】 \033[0m"
  112. echo -e "\033[33m You have chosen to install the latest CentOS_8 \033[0m"
  113. echo -e "\n"
  114. sleep 5s
  115. 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'
  116. fi
  117. if [ $1 = '-CentOS_7' ]
  118. then
  119. echo -e "\033[33m 你选择安装 最新的 【CentOS 7】 \033[0m"
  120. echo -e "\033[33m You have chosen to install the latest CentOS_7 \033[0m"
  121. echo -e "\n"
  122. sleep 5s
  123. 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'
  124. fi
  125. if [ $1 = '-Debian_10' ]
  126. then
  127. echo -e "\033[33m 你选择安装 最新的 【Debian 10】 \033[0m"
  128. echo -e "\033[33m You have chosen to install the latest Debian_10 \033[0m"
  129. echo -e "\n"
  130. sleep 5s
  131. 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
  132. fi
  133. if [ $1 = '-Debian_9' ]
  134. then
  135. echo -e "\033[33m 你选择安装 最新的 【Debian 9】 \033[0m"
  136. echo -e "\033[33m You have chosen to install the latest Debian_9 \033[0m"
  137. echo -e "\n"
  138. sleep 5s
  139. 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
  140. fi
  141. if [ $1 = '-Ubuntu_20.04' ]
  142. then
  143. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 20.04】 \033[0m"
  144. echo -e "\033[33m You have chosen to install the latest Ubuntu_20.04 \033[0m"
  145. echo -e "\n"
  146. sleep 5s
  147. 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
  148. fi
  149. if [ $1 = '-Ubuntu_18.04' ]
  150. then
  151. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 18.04】 \033[0m"
  152. echo -e "\033[33m You have chosen to install the latest Ubuntu_18.04 \033[0m"
  153. echo -e "\n"
  154. sleep 5s
  155. 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
  156. fi
  157. if [ $1 = '-Windows_Server_2019' ]
  158. then
  159. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2019】 \033[0m"
  160. echo -e "\033[33m You have chosen to install the latest Windows_Server_2019 \033[0m"
  161. echo -e "\n"
  162. sleep 5s
  163. 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'
  164. fi
  165. if [ $1 = '-Windows_Server_2019_UEFI' ]
  166. then
  167. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2019】 支持UEFI启动模式 \033[0m"
  168. echo -e "\033[33m You have chosen to install the latest Windows_Server_2019_UEFI \033[0m"
  169. echo -e "\n"
  170. sleep 5s
  171. 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'
  172. fi
  173. if [ $1 = '-Windows_Server_2016' ]
  174. then
  175. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2016】 \033[0m"
  176. echo -e "\033[33m You have chosen to install the latest Windows_Server_2016 \033[0m"
  177. echo -e "\n"
  178. sleep 5s
  179. 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'
  180. fi
  181. if [ $1 = '-Windows_Server_2012R2' ]
  182. then
  183. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2012 R2】 \033[0m"
  184. echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2 \033[0m"
  185. echo -e "\n"
  186. sleep 5s
  187. 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'
  188. fi
  189. if [ $1 = '-Windows_Server_2012R2_UEFI' ]
  190. then
  191. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2012 R2】 支持UEFI启动模式 \033[0m"
  192. echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2_UEFI \033[0m"
  193. echo -e "\n"
  194. sleep 5s
  195. 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'
  196. fi
  197. if [ $1 = '-DD' ]
  198. then
  199. echo -e "\033[33m 你选择安装 【由你指定的自定义镜像】 更多支持信息,你需要向镜像制作者寻求。 \033[0m"
  200. echo -e "\033[33m You have chosen to install the DD package provided by you \033[0m"
  201. echo -e "\n"
  202. sleep 5s
  203. 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
  204. fi
  205. if [ $1 = '-CentOS_6' ]
  206. then
  207. echo -e "\033[33m 你选择安装 最新的 【CentOS 6】(生命周期已结束,无任何支持) \033[0m"
  208. echo -e "\033[33m You have chosen to install the latest CentOS_6 (EOL, No supported) \033[0m"
  209. echo -e "\n"
  210. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  211. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  212. echo -e "\n"
  213. sleep 10s
  214. 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
  215. fi
  216. if [ $1 = '-Debian_8' ]
  217. then
  218. echo -e "\033[33m 你选择安装 最新的 【Debian 8】(生命周期已结束,无任何支持) \033[0m"
  219. echo -e "\033[33m You have chosen to install the latest Debian_8 (EOL, No supported) \033[0m"
  220. echo -e "\n"
  221. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  222. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  223. echo -e "\n"
  224. sleep 10s
  225. 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
  226. fi
  227. if [ $1 = '-Debian_7' ]
  228. then
  229. echo -e "\033[33m 你选择安装 最新的 【Debian 7】(生命周期已结束,无任何支持) \033[0m"
  230. echo -e "\033[33m You have chosen to install the latest Debian_7 (EOL, No supported) \033[0m"
  231. echo -e "\n"
  232. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  233. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  234. echo -e "\n"
  235. sleep 10s
  236. 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
  237. fi
  238. if [ $1 = '-Ubuntu_16.04' ]
  239. then
  240. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 16.04】(生命周期已结束,无任何支持) \033[0m"
  241. echo -e "\033[33m You have chosen to install the latest Ubuntu_16.04 (EOL, No supported) \033[0m"
  242. echo -e "\n"
  243. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  244. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  245. echo -e "\n"
  246. sleep 10s
  247. 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
  248. fi
  249. if [ $1 = '-Ubuntu_14.04' ]
  250. then
  251. echo -e "\033[33m 你选择安装 最新的 【Ubuntu 14.04】(生命周期已结束,无任何支持) \033[0m"
  252. echo -e "\033[33m You have chosen to install the latest Ubuntu_14.04 (EOL, No supported) \033[0m"
  253. echo -e "\n"
  254. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  255. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  256. echo -e "\n"
  257. sleep 10s
  258. 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
  259. fi
  260. if [ $1 = '-Windows_10_Lite' ]
  261. then
  262. echo -e "\033[33m 你选择安装 最新的 【Windows 10 Lite 精简版】(生命周期已结束,无任何支持) \033[0m"
  263. echo -e "\033[33m You have chosen to install the latest Windows_10_Lite (EOL, No supported) \033[0m"
  264. echo -e "\n"
  265. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  266. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  267. echo -e "\n"
  268. sleep 10s
  269. 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'
  270. fi
  271. if [ $1 = '-Windows_Server_2008R2' ]
  272. then
  273. echo -e "\033[33m 你选择安装 最新的 【Windows Server 2008R2】(生命周期已结束,无任何支持) \033[0m"
  274. echo -e "\033[33m You have chosen to install the latest Windows_Server_2008R2 (EOL, No supported) \033[0m"
  275. echo -e "\n"
  276. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  277. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  278. echo -e "\n"
  279. sleep 10s
  280. 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'
  281. fi
  282. if [ $1 = '-Windows_Server_2003R2' ]
  283. then
  284. echo -e "\033[33m 你选择安装 最新的 【Windows_Server_2003R2】(生命周期已结束,无任何支持) \033[0m"
  285. echo -e "\033[33m You have chosen to install the latest Windows_Server_2003R2 (EOL, No supported) \033[0m"
  286. echo -e "\n"
  287. echo -e "\033[41;30m !!!警告:安装生命周期结束的旧系统会导致安全隐患!!! \033[0m"
  288. echo -e "\033[41;30m !!! Warn:Installing the old system will lead to security risks !!! \033[0m"
  289. echo -e "\n"
  290. sleep 10s
  291. 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'
  292. fi
  293. echo "---------------------------------------------------------------------------------------------------------------------"
  294. echo -e "\033[35m 启动 安装 \033[0m"
  295. echo -e "\033[32m Start Installation \033[0m"
  296. echo "---------------------------------------------------------------------------------------------------------------------"
  297. echo -e "\n"
  298. exit