install_server_files.sh 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"
  11. local_filedir="${tmpdir}"
  12. local_filename="action_halflife-1.0.tar.xz"
  13. chmodx="nochmodx"
  14. run="norun"
  15. force="noforce"
  16. md5="61d7b79fd714888b6d65944fdaafa94a"
  17. elif [ "${shortname}" == "bf1942" ]; then
  18. remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"
  19. local_filedir="${tmpdir}"
  20. local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"
  21. chmodx="nochmodx"
  22. run="norun"
  23. force="noforce"
  24. md5="4223bf4ed85f5162c24b2cba51249b9e"
  25. elif [ "${shortname}" == "bfv" ]; then
  26. remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz"
  27. local_filedir="${tmpdir}"
  28. local_filename="bfv_linded-v1.21-20041207_patch.tar.xz"
  29. chmodx="nochmodx"
  30. run="norun"
  31. force="noforce"
  32. md5="e3b4962cdd9d41e23c6fed65101bccde"
  33. elif [ "${shortname}" == "bb" ]; then
  34. remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz"
  35. local_filedir="${tmpdir}"
  36. local_filename="brainbread-v1.2-linuxserver.tar.xz"
  37. chmodx="nochmodx"
  38. run="norun"
  39. force="noforce"
  40. md5="55f227183b736397806d5b6db6143f15"
  41. elif [ "${shortname}" == "cod" ]; then
  42. remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"
  43. local_filedir="${tmpdir}"
  44. local_filename="cod-lnxded-1.5-large.tar.xz"
  45. chmodx="nochmodx"
  46. run="norun"
  47. force="noforce"
  48. md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f"
  49. elif [ "${shortname}" == "coduo" ]; then
  50. remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"
  51. local_filedir="${tmpdir}"
  52. local_filename="coduo-lnxded-1.51b-full.tar.xz"
  53. chmodx="nochmodx"
  54. run="norun"
  55. force="noforce"
  56. md5="35cabccd67adcda44aaebc59405915b9"
  57. elif [ "${shortname}" == "cod2" ]; then
  58. remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"
  59. local_filedir="${tmpdir}"
  60. local_filename="cod2-lnxded-1.3-full.tar.xz"
  61. chmodx="nochmodx"
  62. run="norun"
  63. force="noforce"
  64. md5="b8c4c611f01627dd43348e78478a3d41"
  65. elif [ "${shortname}" == "cod4" ]; then
  66. remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz"
  67. local_filedir="${tmpdir}"
  68. local_filename="cod4x18_lnxded.tar.xz"
  69. chmodx="nochmodx"
  70. run="norun"
  71. force="noforce"
  72. md5="d255b59b9756d7dbead67718208512ee"
  73. elif [ "${shortname}" == "codwaw" ]; then
  74. remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"
  75. local_filedir="${tmpdir}"
  76. local_filename="codwaw-lnxded-1.7-full.tar.xz"
  77. chmodx="nochmodx"
  78. run="norun"
  79. force="noforce"
  80. md5="2c6be1bb66ea631b9b2e7ae6216c6680"
  81. elif [ "${shortname}" == "mohaa" ]; then
  82. remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"
  83. local_filedir="${tmpdir}"
  84. local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"
  85. chmodx="nochmodx"
  86. run="norun"
  87. force="noforce"
  88. md5="7c664538999252eeaf2b6d9949416480"
  89. elif [ "${shortname}" == "ns" ]; then
  90. remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"
  91. local_filedir="${tmpdir}"
  92. local_filename="ns_dedicated_server_v32.tar.xz"
  93. chmodx="nochmodx"
  94. run="norun"
  95. force="noforce"
  96. md5="23ec3cadd93d8bb1c475bad5b9cce370"
  97. elif [ "${shortname}" == "q2" ]; then
  98. remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
  99. local_filedir="${tmpdir}"
  100. local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
  101. chmodx="nochmodx"
  102. run="norun"
  103. force="noforce"
  104. md5="2908164a32d4808bb720f2161f6b0c82"
  105. elif [ "${shortname}" == "q3" ]; then
  106. remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"
  107. local_filedir="${tmpdir}"
  108. local_filename="quake3-1.32c-x86-full-linux.tar.xz"
  109. chmodx="nochmodx"
  110. run="norun"
  111. force="noforce"
  112. md5="b0e26d8919fe9313fb9d8ded2360f3db"
  113. elif [ "${shortname}" == "q4" ]; then
  114. remote_fileurl="http://linuxgsm.download/Quake4/quake4-1.4.2-x86-linuxded.tar.xz"
  115. local_filedir="${tmpdir}"
  116. local_filename="quake4-1.4.2-x86-linuxded.tar.xz"
  117. chmodx="nochmodx"
  118. run="norun"
  119. force="noforce"
  120. md5="afe30b44f23c8ae2ce6f0f464473d8ba"
  121. elif [ "${shortname}" == "qw" ]; then
  122. remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"
  123. local_filedir="${tmpdir}"
  124. local_filename="nquake.server.linux.190506.full.tar.xz"
  125. chmodx="nochmodx"
  126. run="norun"
  127. force="noforce"
  128. md5="82055b7d973206c13a606db8ba288d03"
  129. elif [ "${shortname}" == "rtcw" ]; then
  130. remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
  131. local_filedir="${tmpdir}"
  132. local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
  133. chmodx="nochmodx"
  134. run="norun"
  135. force="noforce"
  136. md5="df6ff664d37dd0d22787848bdb3cac5f"
  137. elif [ "${shortname}" == "sfc" ]; then
  138. remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"
  139. local_filedir="${tmpdir}"
  140. local_filename="SFClassic-1.0-RC7-fix.tar.xz"
  141. chmodx="nochmodx"
  142. run="norun"
  143. force="noforce"
  144. md5="70077137185700e28fe6bbb6021d12bc"
  145. elif [ "${shortname}" == "sof2" ]; then
  146. remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"
  147. local_filedir="${tmpdir}"
  148. local_filename="sof2gold-1.03.tar.xz"
  149. chmodx="nochmodx"
  150. run="norun"
  151. force="noforce"
  152. md5="201e23bab04207d00ce813d001c483d9"
  153. elif [ "${shortname}" == "ts" ]; then
  154. remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"
  155. local_filedir="${tmpdir}"
  156. local_filename="ts-3-linux-final.tar.xz"
  157. chmodx="nochmodx"
  158. run="norun"
  159. force="noforce"
  160. md5="3c66ecff6e3644f7ac88015732a0fb93"
  161. elif [ "${shortname}" == "ut2k4" ]; then
  162. remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"
  163. local_filedir="${tmpdir}"
  164. local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"
  165. chmodx="nochmodx"
  166. run="norun"
  167. force="noforce"
  168. md5="9fceaab68554749f4b45be66613b9a15"
  169. elif [ "${shortname}" == "ut99" ]; then
  170. remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz"
  171. local_filedir="${tmpdir}"
  172. local_filename="ut99-server-469b-ultimate-linux.tar.xz"
  173. chmodx="nochmodx"
  174. run="norun"
  175. force="noforce"
  176. md5="dba3f1122a5e60ee45ece7422fcf78f5"
  177. elif [ "${shortname}" == "ut" ]; then
  178. remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
  179. local_filedir="${tmpdir}"
  180. local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
  181. chmodx="noexecute"
  182. run="norun"
  183. force="noforce"
  184. md5="41dd92015713a78211eaccf503b72393"
  185. elif [ "${shortname}" == "ut3" ]; then
  186. remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1-openspy.tar.xz"
  187. local_filedir="${tmpdir}"
  188. local_filename="UT3-linux-server-2.1-openspy.tar.xz"
  189. chmodx="nochmodx"
  190. run="norun"
  191. force="noforce"
  192. md5="f60b745613a8676666eb6a2450cbdc8e"
  193. elif [ "${shortname}" == "vs" ]; then
  194. remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"
  195. local_filedir="${tmpdir}"
  196. local_filename="vs_l-6.0_full.tar.xz"
  197. chmodx="nochmodx"
  198. run="norun"
  199. force="noforce"
  200. md5="b322f79e0abd31847493c52acf802667"
  201. elif [ "${shortname}" == "wet" ]; then
  202. remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"
  203. local_filedir="${tmpdir}"
  204. local_filename="enemy-territory.260b.tar.xz"
  205. chmodx="nochmodx"
  206. run="norun"
  207. force="noforce"
  208. md5="581a333cc7eacda2f56d5a00fe11eafa"
  209. elif [ "${shortname}" == "samp" ]; then
  210. remote_fileurl="https://files.samp-sc.com/samp037svr_R2-1.tar.gz"
  211. local_filedir="${tmpdir}"
  212. local_filename="samp037svr_R2-1.tar.gz"
  213. chmodx="nochmodx"
  214. run="norun"
  215. force="noforce"
  216. md5="93705e165550c97484678236749198a4"
  217. elif [ "${shortname}" == "zmr" ]; then
  218. remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz"
  219. local_filedir="${tmpdir}"
  220. local_filename="zombie_master_reborn_b6_1.tar.xz"
  221. chmodx="nochmodx"
  222. run="norun"
  223. force="noforce"
  224. md5="0188ae86dbc9376f11ae3032dba2d665"
  225. else
  226. fn_print_fail_nl "Installing ${gamename} Server failed, missing default configuration"
  227. fn_script_log_fail "Installing ${gamename} Server failed, missing default configuration"
  228. fi
  229. fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
  230. fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}"
  231. fn_clear_tmp
  232. }
  233. if [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "ut" ]; then
  234. install_eula.sh
  235. fi
  236. echo -e ""
  237. echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}"
  238. fn_messages_separator
  239. if [ "${appid}" ]; then
  240. remotelocation="SteamCMD"
  241. forceupdate=1
  242. update_steamcmd.sh
  243. fn_check_steamcmd_appmanifest
  244. fi
  245. if [ "${shortname}" == "ts3" ]; then
  246. update_ts3.sh
  247. elif [ "${shortname}" == "mc" ]; then
  248. update_mc.sh
  249. elif [ "${shortname}" == "mcb" ]; then
  250. update_mcb.sh
  251. elif [ "${shortname}" == "pmc" ]; then
  252. update_pmc.sh
  253. elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then
  254. update_pmc.sh
  255. elif [ "${shortname}" == "mta" ]; then
  256. update_mta.sh
  257. elif [ "${shortname}" == "fctr" ]; then
  258. update_fctr.sh
  259. install_factorio_save.sh
  260. elif [ "${shortname}" == "jk2" ]; then
  261. update_jk2.sh
  262. elif [ "${shortname}" == "vints" ]; then
  263. update_vints.sh
  264. elif [ "${shortname}" == "ut99" ]; then
  265. fn_install_server_files
  266. update_ut99.sh
  267. elif [ "${shortname}" == "xnt" ]; then
  268. update_xnt.sh
  269. elif [ "${shortname}" == "etl" ]; then
  270. update_etl.sh
  271. elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then
  272. if [ "${shortname}" == "ut" ]; then
  273. install_eula.sh
  274. fi
  275. fn_install_server_files
  276. fi
  277. if [ -z "${autoinstall}" ]; then
  278. echo -e ""
  279. if ! fn_prompt_yn "Was the install successful?" Y; then
  280. install_retry.sh
  281. fi
  282. fi