Network-Reinstall-System-Modify.sh 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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 Network-Reinstall-System-Modify Tools V3.1.0 2020/09/15 \033[0m"
  20. echo -e "\033[33m [Magic Modify] Reinstall the system (any Windows / Linux) requires only network and one click \033[0m"
  21. echo -e "\033[33m System requirements: Any Linux system with GRUB or GRUB2, recommended CentOS8/Debian10/Ubuntu20 \033[0m"
  22. echo -e "\n"
  23. echo -e "\033[33m [Original] One-click Network Reinstall System - Magic Modify version (For Linux/Windows) \033[0m"
  24. echo -e "\033[33m https://www.cxthhhhh.com/Network-Reinstall-System-Modify \033[0m"
  25. echo "---------------------------------------------------------------------------------------------------------------------"
  26. echo " Default password: cxthhhhh.com"
  27. echo "---------------------------------------------------------------------------------------------------------------------"
  28. echo -e "\n"
  29. sleep 6s
  30. echo "---------------------------------------------------------------------------------------------------------------------"
  31. echo " Pre-environment preparation. . ."
  32. echo "---------------------------------------------------------------------------------------------------------------------"
  33. echo -e "\n"
  34. sleep 2s
  35. if [ -f "/usr/bin/apt-get" ];then
  36. isDebian=`cat /etc/issue|grep Debian`
  37. if [ "$isDebian" != "" ];then
  38. echo 'Current system is Debian'
  39. apt-get install -y xz-utils openssl gawk file wget curl
  40. apt install -y xz-utils openssl gawk file wget curl
  41. sleep 3s
  42. else
  43. echo 'Current system is Ubuntu'
  44. apt-get install -y xz-utils openssl gawk file wget curl
  45. apt install -y xz-utils openssl gawk file wget curl
  46. sleep 3s
  47. fi
  48. else
  49. echo 'Current system is CentOS'
  50. yum install -y xz openssl gawk file wget curl
  51. sleep 3s
  52. fi
  53. echo "---------------------------------------------------------------------------------------------------------------------"
  54. echo " Pre-environment preparation. . . 【OK】"
  55. echo -e "\n"
  56. echo " Start system installation. . . "
  57. echo "---------------------------------------------------------------------------------------------------------------------"
  58. echo -e "\n"
  59. sleep 2s
  60. if [ $1 = '-UI_Options' ]
  61. then
  62. echo -e "\033[33m You have chosen to Start the Graphical Interface Options \033[0m"
  63. echo -e "\n"
  64. sleep 1s
  65. 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
  66. fi
  67. if [ $1 = '-CXT_Bare-metal_System_Deployment_Platform' ]
  68. then
  69. echo -e "\033[33m You have chosen to install the latest CXT_Bare-metal_System_Deployment_Platform \033[0m"
  70. echo -e "\n"
  71. sleep 5s
  72. 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.vhd.gz'
  73. fi
  74. if [ $1 = '-CentOS_8' ]
  75. then
  76. echo -e "\033[33m You have chosen to install the latest CentOS_8 \033[0m"
  77. echo -e "\n"
  78. sleep 5s
  79. 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.vhd.gz'
  80. fi
  81. if [ $1 = '-CentOS_7' ]
  82. then
  83. echo -e "\033[33m You have chosen to install the latest CentOS_7 \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/CentOS/CentOS_7.X_NetInstallation_Final.vhd.gz'
  87. fi
  88. if [ $1 = '-Debian_10' ]
  89. then
  90. echo -e "\033[33m You have chosen to install the latest Debian_10 \033[0m"
  91. echo -e "\n"
  92. sleep 5s
  93. 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
  94. fi
  95. if [ $1 = '-Debian_9' ]
  96. then
  97. echo -e "\033[33m You have chosen to install the latest Debian_9 \033[0m"
  98. echo -e "\n"
  99. sleep 5s
  100. 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
  101. fi
  102. if [ $1 = '-Ubuntu_20.04' ]
  103. then
  104. echo -e "\033[33m You have chosen to install the latest Ubuntu_20.04 \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_2020.sh' && bash Core_Install.sh -u 20.04 -v 64 -a
  108. fi
  109. if [ $1 = '-Ubuntu_18.04' ]
  110. then
  111. echo -e "\033[33m You have chosen to install the latest Ubuntu_18.04 \033[0m"
  112. echo -e "\n"
  113. sleep 5s
  114. 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
  115. fi
  116. if [ $1 = '-Ubuntu_16.04' ]
  117. then
  118. echo -e "\033[33m You have chosen to install the latest Ubuntu_16.04 \033[0m"
  119. echo -e "\n"
  120. sleep 5s
  121. 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
  122. fi
  123. if [ $1 = '-Windows_Server_2019' ]
  124. then
  125. echo -e "\033[33m You have chosen to install the latest Windows_Server_2019 \033[0m"
  126. echo -e "\n"
  127. sleep 5s
  128. 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_Disk/Disk_Windows_Server_2019_DataCenter_CN.vhd.gz'
  129. fi
  130. if [ $1 = '-Windows_Server_2016' ]
  131. then
  132. echo -e "\033[33m You have chosen to install the latest Windows_Server_2016 \033[0m"
  133. echo -e "\n"
  134. sleep 5s
  135. 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_Disk/Disk_Windows_Server_2016_DataCenter_CN.vhd.gz'
  136. fi
  137. if [ $1 = '-Windows_Server_2012R2' ]
  138. then
  139. echo -e "\033[33m You have chosen to install the latest Windows_Server_2012R2 \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 -dd 'https://odc.cxthhhhh.com/SyStem/Windows_DD_Disk/Disk_Windows_Server_2012R2_DataCenter_CN.vhd.gz'
  143. fi
  144. if [ $1 = '-DD' ]
  145. then
  146. echo -e "\033[33m You have chosen to install the DD package provided by you \033[0m"
  147. echo -e "\n"
  148. sleep 5s
  149. 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
  150. fi
  151. if [ $1 = '-CentOS_6' ]
  152. then
  153. echo -e "\033[33m You have chosen to install the latest CentOS_6 \033[0m"
  154. echo -e "\n"
  155. sleep 5s
  156. 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
  157. fi
  158. if [ $1 = '-Debian_8' ]
  159. then
  160. echo -e "\033[33m You have chosen to install the latest Debian_8 \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_2020.sh' && bash Core_Install.sh -d 8 -v 64 -a
  164. fi
  165. if [ $1 = '-Debian_7' ]
  166. then
  167. echo -e "\033[33m You have chosen to install the latest Debian_7 \033[0m"
  168. echo -e "\033[41;30m !!! Installing the old system will lead to security risks !!! \033[0m"
  169. echo -e "\n"
  170. sleep 8s
  171. 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
  172. fi
  173. if [ $1 = '-Ubuntu_14.04' ]
  174. then
  175. echo -e "\033[33m You have chosen to install the latest Ubuntu_14.04 \033[0m"
  176. echo -e "\033[41;30m !!! Installing the old system will lead to security risks !!! \033[0m"
  177. echo -e "\n"
  178. sleep 8s
  179. 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
  180. fi
  181. if [ $1 = '-Windows_10_Lite' ]
  182. then
  183. echo -e "\033[33m You have chosen to install the latest Windows_10_Lite \033[0m"
  184. echo -e "\n"
  185. sleep 5s
  186. 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_Disk/Disk_Windows_10_x64_Lite_by_CXT.vhd.gz'
  187. fi
  188. if [ $1 = '-Windows_Server_2008R2' ]
  189. then
  190. echo -e "\033[33m You have chosen to install the latest Windows_Server_2008R2 \033[0m"
  191. echo -e "\033[41;30m !!! Installing the old system will lead to security risks !!! \033[0m"
  192. echo -e "\n"
  193. sleep 8s
  194. 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_Disk/Disk_Windows_Server_2008R2_DataCenter_CN.vhd.gz'
  195. fi
  196. if [ $1 = '-Windows_7_Vienna' ]
  197. then
  198. echo -e "\033[33m You have chosen to install the latest Windows_7_Vienna \033[0m"
  199. echo -e "\033[41;30m !!! Installing the old system will lead to security risks !!! \033[0m"
  200. echo -e "\n"
  201. sleep 8s
  202. 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_Disk/Disk_Windows_7_Vienna_Ultimate_CN.vhd.gz'
  203. fi
  204. if [ $1 = '-Windows_Server_2003' ]
  205. then
  206. echo -e "\033[33m You have chosen to install the latest Windows_Server_2003 \033[0m"
  207. echo -e "\033[41;30m !!! Installing the old system will lead to security risks !!! \033[0m"
  208. echo -e "\n"
  209. sleep 8s
  210. 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_Disk/Disk_Windows_Server_2003_DataCenter_CN.vhd.gz'
  211. fi
  212. echo "---------------------------------------------------------------------------------------------------------------------"
  213. echo -e "\033[35m Start Installation \033[0m"
  214. echo -e "\033[32m Start Installation \033[0m"
  215. echo "---------------------------------------------------------------------------------------------------------------------"
  216. echo -e "\n"
  217. exit