install_server_files.sh 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. #!/bin/bash
  2. # LinuxGSM install_server_files.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Installs server files.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. fn_install_server_files() {
  9. if [ "${shortname}" == "ahl" ]; then
  10. remote_fileurl="https://linuxgsm.download/ActionHalfLife/ahl-1.0-linux-i386-linuxgsm-20261102.tar.xz"
  11. local_filedir="${tmpdir}"
  12. local_filename="ahl-1.0-linux-i386-linuxgsm-20261102.tar.xz"
  13. chmodx="nochmodx"
  14. run="norun"
  15. force="noforce"
  16. md5="4b502ed86fafd44b9b9dda99ee4cb44f"
  17. elif [ "${shortname}" == "bf1942" ]; then
  18. remote_fileurl="https://linuxgsm.download/BattleField1942/bf1942-1.612-linux-i386-linuxgsm-20261101.tar.xz"
  19. local_filedir="${tmpdir}"
  20. local_filename="bf1942-1.612-linux-i386-linuxgsm-20261101.tar.xz"
  21. chmodx="nochmodx"
  22. run="norun"
  23. force="noforce"
  24. md5="0a3ae8721d3b14d81912b01fbfbd5cb2"
  25. elif [ "${shortname}" == "bfv" ]; then
  26. remote_fileurl="https://linuxgsm.download/BattlefieldVietnam/bfv-1.21-linux-i386-linuxgsm-20261101.tar.xz"
  27. local_filedir="${tmpdir}"
  28. local_filename="bfv-1.21-linux-i386-linuxgsm-20261101.tar.xz"
  29. chmodx="nochmodx"
  30. run="norun"
  31. force="noforce"
  32. md5="532bc18529c7cb86fb41c79ec61c5283"
  33. elif [ "${shortname}" == "cod" ]; then
  34. remote_fileurl="https://linuxgsm.download/CallOfDuty/cod-1.5b-linux-i386-linuxgsm-20261102.tar.xz"
  35. local_filedir="${tmpdir}"
  36. local_filename="cod-1.5b-linux-i386-linuxgsm-20261102.tar.xz"
  37. chmodx="nochmodx"
  38. run="norun"
  39. force="noforce"
  40. md5="a588df9db95f64ce5b5065fd94995bc1"
  41. elif [ "${shortname}" == "coduo" ]; then
  42. remote_fileurl="https://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-1.51b-linux-i386-linuxgsm-20261102.tar.xz"
  43. local_filedir="${tmpdir}"
  44. local_filename="coduo-1.51b-linux-i386-linuxgsm-20261102.tar.xz"
  45. chmodx="nochmodx"
  46. run="norun"
  47. force="noforce"
  48. md5="deb2f9a66c9f3c7a23099c31c98242d0"
  49. elif [ "${shortname}" == "cod2" ]; then
  50. remote_fileurl="https://linuxgsm.download/CallOfDuty2/cod2-1.3-linux-i386-linuxgsm-20261101.tar.xz"
  51. local_filedir="${tmpdir}"
  52. local_filename="cod2-1.3-linux-i386-linuxgsm-20261101.tar.xz"
  53. chmodx="nochmodx"
  54. run="norun"
  55. force="noforce"
  56. md5="e7dfaaf11f3f714c60e2ac1057476aa4"
  57. elif [ "${shortname}" == "cod4" ]; then
  58. remote_fileurl="https://linuxgsm.download/CallOfDuty4/cod4x-21.2-linux-i386-linuxgsm-20261102.tar.xz"
  59. local_filedir="${tmpdir}"
  60. local_filename="cod4x-21.2-linux-i386-linuxgsm-20261102.tar.xz"
  61. chmodx="nochmodx"
  62. run="norun"
  63. force="noforce"
  64. md5="7c8d55d12e44f321f31ad1320567659a"
  65. elif [ "${shortname}" == "codwaw" ]; then
  66. remote_fileurl="https://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-1.7-linux-i386-linuxgsm-20261101.tar.xz"
  67. local_filedir="${tmpdir}"
  68. local_filename="codwaw-1.7-linux-i386-linuxgsm-20261101.tar.xz"
  69. chmodx="nochmodx"
  70. run="norun"
  71. force="noforce"
  72. md5="d7bdc6b2a671c3e07184e1a3262ec14c"
  73. elif [ "${shortname}" == "cswon" ]; then
  74. remote_fileurl="https://linuxgsm.download/CounterStrikeWON2/cswon-3111e-cs15-linux-i386-linuxgsm-20261102.tar.xz"
  75. local_filedir="${tmpdir}"
  76. local_filename="cswon-3111e-cs15-linux-i386-linuxgsm-20261102.tar.xz"
  77. chmodx="nochmodx"
  78. run="norun"
  79. force="noforce"
  80. md5="0be5f9f766e48b8bbd480dfa4a9d9aa0"
  81. elif [ "${shortname}" == "hlwon" ]; then
  82. remote_fileurl="https://linuxgsm.download/HalfLifeWON2/hlwon-3111e-linux-i386-linuxgsm-20261102.tar.xz"
  83. local_filedir="${tmpdir}"
  84. local_filename="hlwon-3111e-linux-i386-linuxgsm-20261102.tar.xz"
  85. chmodx="nochmodx"
  86. run="norun"
  87. force="noforce"
  88. md5="e64fda09d31f3acc977fb621b5ffd4fd"
  89. elif [ "${shortname}" == "mohaa" ]; then
  90. remote_fileurl="https://linuxgsm.download/MedalofHonorAlliedAssault/mohaa-1.12-rc3.5.1-linux-i386-linuxgsm-20261102.tar.xz"
  91. local_filedir="${tmpdir}"
  92. local_filename="mohaa-1.12-rc3.5.1-linux-i386-linuxgsm-20261102.tar.xz"
  93. chmodx="nochmodx"
  94. run="norun"
  95. force="noforce"
  96. md5="bf66cbe1f4aefb221e17924e7bf9bdb4"
  97. elif [ "${shortname}" == "ns" ]; then
  98. remote_fileurl="https://linuxgsm.download/NaturalSelection/ns-3.2-linux-i386-linuxgsm-20261102.tar.xz"
  99. local_filedir="${tmpdir}"
  100. local_filename="ns-3.2-linux-i386-linuxgsm-20261102.tar.xz"
  101. chmodx="nochmodx"
  102. run="norun"
  103. force="noforce"
  104. md5="a44d9769f9a035b98a4d57a7d7e1f81b"
  105. elif [ "${shortname}" == "q2" ]; then
  106. remote_fileurl="https://linuxgsm.download/Quake2/q2-3.20-linux-i386-linuxgsm-20261102.tar.xz"
  107. local_filedir="${tmpdir}"
  108. local_filename="q2-3.20-linux-i386-linuxgsm-20261102.tar.xz"
  109. chmodx="nochmodx"
  110. run="norun"
  111. force="noforce"
  112. md5="f0abe39ed649765cd99b7e5e1c62b4f6"
  113. elif [ "${shortname}" == "q3" ]; then
  114. remote_fileurl="https://linuxgsm.download/Quake3/q3-1.32c-linux-i386-linuxgsm-20261101.tar.xz"
  115. local_filedir="${tmpdir}"
  116. local_filename="q3-1.32c-linux-i386-linuxgsm-20261101.tar.xz"
  117. chmodx="nochmodx"
  118. run="norun"
  119. force="noforce"
  120. md5="e6c958f4e01845d06bd5b8f3835bafa0"
  121. elif [ "${shortname}" == "q4" ]; then
  122. remote_fileurl="https://linuxgsm.download/Quake4/q4-1.4.2-linux-i386-linuxgsm-20261101.tar.xz"
  123. local_filedir="${tmpdir}"
  124. local_filename="q4-1.4.2-linux-i386-linuxgsm-20261101.tar.xz"
  125. chmodx="nochmodx"
  126. run="norun"
  127. force="noforce"
  128. md5="7aaa88fb0ba0c533fe23b7b993fd6530"
  129. elif [ "${shortname}" == "qw" ]; then
  130. remote_fileurl="https://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"
  131. local_filedir="${tmpdir}"
  132. local_filename="nquake.server.linux.190506.full.tar.xz"
  133. chmodx="nochmodx"
  134. run="norun"
  135. force="noforce"
  136. md5="82055b7d973206c13a606db8ba288d03"
  137. elif [ "${shortname}" == "rtcw" ]; then
  138. remote_fileurl="https://linuxgsm.download/ReturnToCastleWolfenstein/rtcw-iortcw-1.51c-linux-amd64-linuxgsm-20261102.tar.xz"
  139. local_filedir="${tmpdir}"
  140. local_filename="rtcw-iortcw-1.51c-linux-amd64-linuxgsm-20261102.tar.xz"
  141. chmodx="nochmodx"
  142. run="norun"
  143. force="noforce"
  144. md5="6bb410ac0faf9048c2ca8f918b068ed0"
  145. elif [ "${shortname}" == "sfc" ]; then
  146. remote_fileurl="https://linuxgsm.download/SourceFortsClassic/sfc-1.0-rc7-fix-linux-i386-linuxgsm-20261102.tar.xz"
  147. local_filedir="${tmpdir}"
  148. local_filename="sfc-1.0-rc7-fix-linux-i386-linuxgsm-20261102.tar.xz"
  149. chmodx="nochmodx"
  150. run="norun"
  151. force="noforce"
  152. md5="a0e3980e944cd321c5f064d752a7431e"
  153. elif [ "${shortname}" == "sof2" ]; then
  154. remote_fileurl="https://linuxgsm.download/SoldierOfFortune2/sof2-1.03-linux-i386-linuxgsm-20261101.tar.xz"
  155. local_filedir="${tmpdir}"
  156. local_filename="sof2-1.03-linux-i386-linuxgsm-20261101.tar.xz"
  157. chmodx="nochmodx"
  158. run="norun"
  159. force="noforce"
  160. md5="d8cd9ad624290a1de1c72e43aa35195e"
  161. elif [ "${shortname}" == "ts" ]; then
  162. remote_fileurl="https://linuxgsm.download/TheSpecialists/ts-3.0-linux-i386-linuxgsm-20261102.tar.xz"
  163. local_filedir="${tmpdir}"
  164. local_filename="ts-3.0-linux-i386-linuxgsm-20261102.tar.xz"
  165. chmodx="nochmodx"
  166. run="norun"
  167. force="noforce"
  168. md5="4ff0fdc126ec09c07d6a6f915cb9145f"
  169. elif [ "${shortname}" == "ut2k4" ]; then
  170. remote_fileurl="https://linuxgsm.download/UnrealTournament2004/ut2k4-3369.3-linux-i386-linuxgsm-20261102.tar.xz"
  171. local_filedir="${tmpdir}"
  172. local_filename="ut2k4-3369.3-linux-i386-linuxgsm-20261102.tar.xz"
  173. chmodx="nochmodx"
  174. run="norun"
  175. force="noforce"
  176. md5="f0ce6b3d3c7831e1a45e2a436a6aaa3b"
  177. elif [ "${shortname}" == "ut99" ]; then
  178. remote_fileurl="https://linuxgsm.download/UnrealTournament99/ut99-469b-linux-i386-linuxgsm-20261102.tar.xz"
  179. local_filedir="${tmpdir}"
  180. local_filename="ut99-469b-linux-i386-linuxgsm-20261102.tar.xz"
  181. chmodx="nochmodx"
  182. run="norun"
  183. force="noforce"
  184. md5="ccb9b0907f2f926204c911c3041df743"
  185. elif [ "${shortname}" == "ut" ]; then
  186. remote_fileurl="https://linuxgsm.download/UnrealTournament/ut-xan-3525360-linux-amd64-linuxgsm-20261102.tar.xz"
  187. local_filedir="${tmpdir}"
  188. local_filename="ut-xan-3525360-linux-amd64-linuxgsm-20261102.tar.xz"
  189. chmodx="noexecute"
  190. run="norun"
  191. force="noforce"
  192. md5="ffcb25dd03d82489e0cb3d6b9779e818"
  193. elif [ "${shortname}" == "ut3" ]; then
  194. remote_fileurl="https://linuxgsm.download/UnrealTournament3/ut3-2.1-openspy-linux-i386-linuxgsm-20261102.tar.xz"
  195. local_filedir="${tmpdir}"
  196. local_filename="ut3-2.1-openspy-linux-i386-linuxgsm-20261102.tar.xz"
  197. chmodx="nochmodx"
  198. run="norun"
  199. force="noforce"
  200. md5="a1ca829bd56d9a1abd17bf129e2bcb77"
  201. elif [ "${shortname}" == "vs" ]; then
  202. remote_fileurl="https://linuxgsm.download/VampireSlayer/vs-6.0-linux-i386-linuxgsm-20261102.tar.xz"
  203. local_filedir="${tmpdir}"
  204. local_filename="vs-6.0-linux-i386-linuxgsm-20261102.tar.xz"
  205. chmodx="nochmodx"
  206. run="norun"
  207. force="noforce"
  208. md5="c1f908ab27772d8c6ca8ee731d32ddda"
  209. elif [ "${shortname}" == "wet" ]; then
  210. remote_fileurl="https://linuxgsm.download/WolfensteinEnemyTerritory/wet-2.60b-linux-i386-linuxgsm-20261101.tar.xz"
  211. local_filedir="${tmpdir}"
  212. local_filename="wet-2.60b-linux-i386-linuxgsm-20261101.tar.xz"
  213. chmodx="nochmodx"
  214. run="norun"
  215. force="noforce"
  216. md5="60b7483c22db98effc3622dbb9e5710f"
  217. elif [ "${shortname}" == "samp" ]; then
  218. remote_fileurl="https://files.samp-sc.com/samp037svr_R2-1.tar.gz"
  219. local_filedir="${tmpdir}"
  220. local_filename="samp037svr_R2-1.tar.gz"
  221. chmodx="nochmodx"
  222. run="norun"
  223. force="noforce"
  224. md5="93705e165550c97484678236749198a4"
  225. elif [ "${shortname}" == "zmr" ]; then
  226. remote_fileurl="https://linuxgsm.download/ZombieMasterReborn/zmr-b6.1-linux-i386-linuxgsm-20261102.tar.xz"
  227. local_filedir="${tmpdir}"
  228. local_filename="zmr-b6.1-linux-i386-linuxgsm-20261102.tar.xz"
  229. chmodx="nochmodx"
  230. run="norun"
  231. force="noforce"
  232. md5="f451da013ed386d3081dfcfc390c7723"
  233. else
  234. fn_print_fail_nl "Installing ${gamename} Server failed, missing default configuration"
  235. fn_script_log_fail "Installing ${gamename} Server failed, missing default configuration"
  236. core_exit.sh
  237. fi
  238. fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
  239. fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}"
  240. fn_clear_tmp
  241. }
  242. if [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "ut" ]; then
  243. install_eula.sh
  244. fi
  245. echo -e ""
  246. echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}"
  247. fn_messages_separator
  248. if [ "${appid}" ]; then
  249. remotelocation="SteamCMD"
  250. forceupdate=1
  251. update_steamcmd.sh
  252. fn_check_steamcmd_appmanifest
  253. fi
  254. if [ "${shortname}" == "ts3" ]; then
  255. update_ts3.sh
  256. elif [ "${shortname}" == "mc" ]; then
  257. update_mc.sh
  258. elif [ "${shortname}" == "mcb" ]; then
  259. update_mcb.sh
  260. elif [ "${shortname}" == "pmc" ]; then
  261. update_pmc.sh
  262. elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then
  263. update_pmc.sh
  264. elif [ "${shortname}" == "mta" ]; then
  265. update_mta.sh
  266. elif [ "${shortname}" == "fctr" ]; then
  267. update_fctr.sh
  268. install_factorio_save.sh
  269. elif [ "${shortname}" == "fivem" ]; then
  270. update_fivem.sh
  271. elif [ "${shortname}" == "hyt" ]; then
  272. update_hyt.sh
  273. elif [ "${shortname}" == "jk2" ]; then
  274. update_jk2.sh
  275. elif [ "${shortname}" == "jk3" ]; then
  276. update_jk3.sh
  277. elif [ "${shortname}" == "luanti" ]; then
  278. update_luanti.sh
  279. elif [ "${shortname}" == "orar" ]; then
  280. update_openra.sh
  281. elif [ "${shortname}" == "vints" ]; then
  282. update_vints.sh
  283. elif [ "${shortname}" == "bfe" ]; then
  284. update_bfe.sh
  285. elif [ "${shortname}" == "bb" ]; then
  286. update_bb.sh
  287. elif [ "${shortname}" == "ut99" ]; then
  288. fn_install_server_files
  289. update_ut99.sh
  290. elif [ "${shortname}" == "xnt" ]; then
  291. update_xnt.sh
  292. elif [ "${shortname}" == "etl" ]; then
  293. update_etl.sh
  294. elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then
  295. if [ "${shortname}" == "ut" ]; then
  296. install_eula.sh
  297. fi
  298. fn_install_server_files
  299. fi
  300. if [ -z "${autoinstall}" ]; then
  301. echo -e ""
  302. if ! fn_prompt_yn "Was the install successful?" Y; then
  303. install_retry.sh
  304. fi
  305. fi