core_steamcmd.sh 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. #!/bin/bash
  2. # LinuxGSM core_steamcmd.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Core modules for SteamCMD
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. fn_install_steamcmd() {
  9. if [ "${shortname}" == "ark" ] && [ "${installsteamcmd}" == "1" ]; then
  10. steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
  11. fi
  12. if [ ! -d "${steamcmddir}" ]; then
  13. mkdir -p "${steamcmddir}"
  14. fi
  15. fn_fetch_file "https://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "nochmodx" "norun" "noforce" "nohash"
  16. fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" || return 1
  17. chmod +x "${steamcmddir}/steamcmd.sh"
  18. }
  19. fn_check_steamcmd_user() {
  20. # Checks if steamuser is setup.
  21. if [ "${steamuser}" == "username" ]; then
  22. fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
  23. fn_print_nl " * Change steamuser=\"username\" to a valid steam login."
  24. fn_script_log_fail "Steam login not set. Update steamuser in ${configdirserver}"
  25. core_exit.sh
  26. fi
  27. # Anonymous user is set if steamuser is missing.
  28. if [ -z "${steamuser}" ]; then
  29. if [ -d "${lgsmlogdir}" ]; then
  30. fn_script_log_info "Using anonymous Steam login"
  31. fi
  32. steamuser="anonymous"
  33. steampass=''
  34. fi
  35. }
  36. fn_check_steamcmd() {
  37. # Checks if SteamCMD exists when starting or updating a server.
  38. # Only install if steamcmd package is missing or steamcmd dir is missing.
  39. if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then
  40. if [ "${commandname}" == "INSTALL" ]; then
  41. fn_print_nl "install SteamCMD"
  42. fn_install_steamcmd
  43. else
  44. fn_print_warn_nl "SteamCMD is not installed"
  45. fn_script_log_warn "SteamCMD is not installed"
  46. fn_install_steamcmd
  47. fi
  48. elif [ "${commandname}" == "INSTALL" ]; then
  49. fn_print "install SteamCMD"
  50. fn_print_skip_eol_nl
  51. fi
  52. }
  53. fn_check_steamcmd_dir() {
  54. # Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard.
  55. # https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347
  56. # Create Steam installation directory.
  57. if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
  58. mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam"
  59. fi
  60. # Create common Steam directory.
  61. if [ ! -d "${HOME}/.steam" ]; then
  62. mkdir -p "${HOME}/.steam"
  63. fi
  64. # Symbolic links to Steam installation directory.
  65. if [ ! -L "${HOME}/.steam/root" ]; then
  66. if [ -d "${HOME}/.steam/root" ]; then
  67. rm -f "${HOME:?}/.steam/root"
  68. fi
  69. ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root"
  70. fi
  71. if [ ! -L "${HOME}/.steam/steam" ]; then
  72. if [ -d "${HOME}/.steam/steam" ]; then
  73. rm -rf "${HOME}/.steam/steam"
  74. fi
  75. ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam"
  76. fi
  77. }
  78. fn_check_steamcmd_dir_legacy() {
  79. # Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd
  80. if [ -d "${rootdir}/steamcmd" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
  81. rm -rf "${rootdir:?}/steamcmd"
  82. fi
  83. if [ -d "${HOME}/Steam" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
  84. rm -rf "${HOME}/Steam"
  85. fi
  86. }
  87. fn_check_steamcmd_steamapp() {
  88. # Check that steamapp directory fixes issue #3481
  89. if [ ! -d "${serverfiles}/steamapps" ]; then
  90. mkdir -p "${serverfiles}/steamapps"
  91. fi
  92. }
  93. fn_check_steamcmd_ark() {
  94. # Checks if SteamCMD exists in
  95. # Engine/Binaries/ThirdParty/SteamCMD/Linux
  96. # to allow ark mods to work
  97. if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
  98. installsteamcmd=1
  99. if [ "${commandname}" == "INSTALL" ]; then
  100. fn_install_steamcmd
  101. else
  102. fn_print_warn_nl "ARK mods SteamCMD is missing"
  103. fn_script_log_warn "ARK mods SteamCMD is missing"
  104. fn_install_steamcmd
  105. fi
  106. elif [ "${commandname}" == "INSTALL" ]; then
  107. fn_print_information "ARK mods SteamCMD is already installed..."
  108. fn_print_ok_eol_nl
  109. fi
  110. }
  111. fn_check_steamcmd_clear() {
  112. # Will remove steamcmd dir if steamcmd package is installed.
  113. if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then
  114. rm -rf "${steamcmddir:?}"
  115. exitcode=$?
  116. if [ "${exitcode}" -ne 0 ]; then
  117. fn_script_log_fail "Removing ${rootdir}/steamcmd"
  118. else
  119. fn_script_log_pass "Removing ${rootdir}/steamcmd"
  120. fi
  121. fi
  122. }
  123. fn_check_steamcmd_exec() {
  124. if [ "$(command -v steamcmd 2> /dev/null)" ]; then
  125. steamcmdcommand="steamcmd"
  126. else
  127. steamcmdcommand="./steamcmd.sh"
  128. fi
  129. }
  130. fn_update_steamcmd_localbuild() {
  131. # Gets local build info.
  132. fn_print_dots "Checking local build: ${remotelocation}"
  133. fn_check_steamcmd_appmanifest
  134. # Uses appmanifest to find local build.
  135. localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3)
  136. # Checks if localbuild variable has been set.
  137. if [ -z "${localbuild}" ]; then
  138. fn_print_fail "Checking local build: ${remotelocation}: missing local build info"
  139. fn_script_log_fail "Missing local build info"
  140. core_exit.sh
  141. else
  142. fn_print_ok "Checking local build: ${remotelocation}"
  143. fn_script_log_pass "Checking local build"
  144. fi
  145. }
  146. fn_update_steamcmd_remotebuild() {
  147. # Gets remote build info.
  148. if [ -d "${steamcmddir}" ]; then
  149. cd "${steamcmddir}" || exit
  150. fi
  151. # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD.
  152. if [ "$(find "${HOME}" -type f -name "appinfo.vdf" 2> /dev/null | wc -l)" -ne "0" ]; then
  153. find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; 2> /dev/null
  154. fi
  155. # Set branch to public if no custom branch.
  156. if [ -z "${branch}" ]; then
  157. branch="public"
  158. fi
  159. # added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it.
  160. if [ "${CI}" ]; then
  161. ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit > /dev/null 2>&1
  162. fi
  163. # password for branch not needed to check the buildid
  164. remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')
  165. if [ "${firstcommandname}" != "INSTALL" ]; then
  166. fn_print_dots "Checking remote build: ${remotelocation}"
  167. # Checks if remotebuild variable has been set.
  168. if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then
  169. fn_print_fail "Checking remote build: ${remotelocation}"
  170. fn_script_log_fail "Checking remote build"
  171. core_exit.sh
  172. else
  173. fn_print_ok "Checking remote build: ${remotelocation}"
  174. fn_script_log_pass "Checking remote build"
  175. fi
  176. else
  177. # Checks if remotebuild variable has been set.
  178. if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then
  179. fn_print_failure "Unable to get remote build"
  180. fn_script_log_fail "Unable to get remote build"
  181. core_exit.sh
  182. fi
  183. fi
  184. }
  185. fn_update_steamcmd_compare() {
  186. fn_print_dots "Checking for update: ${remotelocation}"
  187. # Update has been found or force update.
  188. if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then
  189. # Create update lockfile.
  190. date '+%s' > "${lockdir:?}/update.lock"
  191. fn_print_ok_nl "Checking for update: ${remotelocation}"
  192. fn_print "\n"
  193. fn_print_nl "${bold}${underline}Update${default} available"
  194. fn_print_nl "* Local build: ${red}${localbuild}${default}"
  195. fn_print_nl "* Remote build: ${green}${remotebuild}${default}"
  196. if [ -n "${branch}" ]; then
  197. fn_print_nl "* Branch: ${branch}"
  198. fi
  199. if [ -n "${betapassword}" ]; then
  200. fn_print_nl "* Branch password: ********"
  201. fi
  202. fn_print_nl "${italic}https://steamdb.info/app/${appid}/history"
  203. fn_print "\n"
  204. fn_script_log_info "Update available"
  205. fn_script_log_info "Local build: ${localbuild}"
  206. fn_script_log_info "Remote build: ${remotebuild}"
  207. if [ -n "${branch}" ]; then
  208. fn_script_log_info "Branch: ${branch}"
  209. fi
  210. if [ -n "${betapassword}" ]; then
  211. fn_script_log_info "Branch password: ********"
  212. fi
  213. fn_script_log_info "${localbuild} > ${remotebuild}"
  214. if [ "${commandname}" == "UPDATE" ]; then
  215. unset updateonstart
  216. fn_update_apply fn_dl_steamcmd
  217. alert="update"
  218. elif [ "${commandname}" == "CHECK-UPDATE" ]; then
  219. alert="check-update"
  220. fi
  221. alert.sh
  222. else
  223. fn_print_ok_nl "Checking for update: ${remotelocation}"
  224. fn_print "\n"
  225. fn_print_nl "${bold}${underline}No update${default} available"
  226. fn_print_nl "* Local build: ${green}${localbuild}${default}"
  227. fn_print_nl "* Remote build: ${green}${remotebuild}${default}"
  228. if [ -n "${branch}" ]; then
  229. fn_print_nl "* Branch: ${branch}"
  230. fi
  231. if [ -n "${betapassword}" ]; then
  232. fn_print_nl "* Branch password: ********"
  233. fi
  234. fn_print_nl "https://steamdb.info/app/${appid}/history"
  235. fn_print "\n"
  236. fn_script_log_info "No update available"
  237. fn_script_log_info "Local build: ${localbuild}"
  238. fn_script_log_info "Remote build: ${remotebuild}"
  239. if [ -n "${branch}" ]; then
  240. fn_script_log_info "Branch: ${branch}"
  241. fi
  242. if [ -n "${betapassword}" ]; then
  243. fn_script_log_info "Branch password: ********"
  244. fi
  245. fi
  246. }
  247. fn_appmanifest_info() {
  248. appmanifestfile=$(find -L "${serverfiles}/steamapps" -type f -name "appmanifest_${appid}.acf")
  249. appmanifestfilewc=$(find -L "${serverfiles}/steamapps" -type f -name "appmanifest_${appid}.acf" | wc -l)
  250. }
  251. fn_check_steamcmd_appmanifest() {
  252. fn_appmanifest_info
  253. # Multiple or no matching appmanifest files may sometimes be present.
  254. if [ "${appmanifestfilewc}" -ge "2" ]; then
  255. fn_print_error "Multiple appmanifest_${appid}.acf files found"
  256. fn_script_log_error "Multiple appmanifest_${appid}.acf files found"
  257. fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files"
  258. for appfile in ${appmanifestfile}; do
  259. rm -f "${appfile:?}"
  260. done
  261. appmanifestfilewc1="${appmanifestfilewc}"
  262. fn_appmanifest_info
  263. # if error can not be resolved.
  264. if [ "${appmanifestfilewc}" -ge "2" ]; then
  265. fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
  266. fn_script_log_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
  267. fn_print_nl "* Check user permissions"
  268. for appfile in ${appmanifestfile}; do
  269. fn_print_nl " ${appfile}"
  270. done
  271. core_exit.sh
  272. else
  273. fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
  274. fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
  275. fn_print_info_nl "Forcing update to correct issue"
  276. fn_script_log_info "Forcing update to correct issue"
  277. fn_dl_steamcmd
  278. fi
  279. elif [ "${appmanifestfilewc}" -eq "0" ]; then
  280. fn_print_error_nl "No appmanifest_${appid}.acf found"
  281. fn_script_log_error "No appmanifest_${appid}.acf found"
  282. fn_print_info_nl "Forcing update to correct issue"
  283. fn_script_log_info "Forcing update to correct issue"
  284. fn_dl_steamcmd
  285. fn_appmanifest_info
  286. if [ "${appmanifestfilewc}" -eq "0" ]; then
  287. fn_print_fail_nl "Still no appmanifest_${appid}.acf found"
  288. fn_script_log_fail "Still no appmanifest_${appid}.acf found"
  289. core_exit.sh
  290. fi
  291. fi
  292. # Checking for half completed updates.
  293. bytesdownloaded=$(grep BytesDownloaded "${appmanifestfile}" | tr -cd '[:digit:]')
  294. bytestodownload=$(grep BytesToDownload "${appmanifestfile}" | tr -cd '[:digit:]')
  295. if [ "${bytesdownloaded}" != "${bytestodownload}" ]; then
  296. fn_print_error_nl "BytesDownloaded and BytesToDownload do not match"
  297. fn_script_log_error "BytesDownloaded and BytesToDownload do not match"
  298. fn_print_info_nl "Forcing update to correct issue"
  299. fn_script_log_info "Forcing update to correct issue"
  300. fn_dl_steamcmd
  301. fi
  302. bytesstaged=$(grep BytesStaged "${appmanifestfile}" | tr -cd '[:digit:]')
  303. bytestostage=$(grep BytesToStage "${appmanifestfile}" | tr -cd '[:digit:]')
  304. if [ "${bytesstaged}" != "${bytestostage}" ]; then
  305. fn_print_error_nl "BytesStaged and BytesToStage do not match"
  306. fn_script_log_error "BytesStaged and BytesToStage do not match"
  307. fn_print_info_nl "Forcing update to correct issue"
  308. fn_script_log_info "Forcing update to correct issue"
  309. fn_dl_steamcmd
  310. fi
  311. # if engine is GoldSrc check SharedDepots exists in appmanifest_90.acf
  312. if [ "${engine}" == "goldsrc" ]; then
  313. shareddepotsexists=$(grep -c SharedDepots "${serverfiles}/steamapps/appmanifest_90.acf")
  314. if [ ! -f "${serverfiles}/steamapps/appmanifest_90.acf" ] || [ "${shareddepotsexists}" == "0" ]; then
  315. fn_print_error_nl "SharedDepots missing from appmanifest_90.acf"
  316. fn_script_log_error "SharedDepots missing from appmanifest_90.acf"
  317. fn_print_info_nl "Forcing update to correct issue"
  318. fn_script_log_info "Forcing update to correct issue"
  319. if [ "${shortname}" == "ahl" ]; then
  320. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  321. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  322. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  323. elif [ "${shortname}" == "bb" ]; then
  324. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  325. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  326. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  327. elif [ "${shortname}" == "cscz" ]; then
  328. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  329. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  330. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  331. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_80.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  332. elif [ "${shortname}" == "css" ]; then
  333. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  334. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  335. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  336. elif [ "${shortname}" == "dmc" ]; then
  337. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  338. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  339. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_40.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  340. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  341. elif [ "${shortname}" == "dod" ]; then
  342. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  343. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  344. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_30.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  345. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  346. elif [ "${shortname}" == "hldm" ]; then
  347. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  348. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  349. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  350. elif [ "${shortname}" == "ns" ]; then
  351. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  352. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  353. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  354. elif [ "${shortname}" == "opfor" ]; then
  355. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  356. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  357. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_50.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  358. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  359. elif [ "${shortname}" == "ricochet" ]; then
  360. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  361. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  362. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_60.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  363. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  364. elif [ "${shortname}" == "tfc" ]; then
  365. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  366. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  367. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_20.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  368. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  369. elif [ "${shortname}" == "ts" ]; then
  370. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  371. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  372. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  373. elif [ "${shortname}" == "vs" ]; then
  374. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  375. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  376. fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
  377. fi
  378. fn_dl_steamcmd
  379. fi
  380. fi
  381. # GoldSrc can occasionally report success while core HL1 files are incomplete.
  382. if [ "${engine}" == "goldsrc" ]; then
  383. if [ ! -f "${serverfiles}/hlds_run" ] || [ ! -f "${serverfiles}/engine_i486.so" ] || [ ! -d "${serverfiles}/valve" ]; then
  384. fn_print_error_nl "Core HL1 files missing after GoldSrc update"
  385. fn_script_log_error "Core HL1 files missing after GoldSrc update"
  386. fn_print_info_nl "Forcing update to correct issue"
  387. fn_script_log_info "Forcing update to correct issue"
  388. fn_dl_steamcmd
  389. if [ ! -f "${serverfiles}/hlds_run" ] || [ ! -f "${serverfiles}/engine_i486.so" ] || [ ! -d "${serverfiles}/valve" ]; then
  390. fn_print_fail_nl "Core HL1 files are still missing after retry"
  391. fn_script_log_fail "Core HL1 files are still missing after retry"
  392. core_exit.sh
  393. fi
  394. fi
  395. fi
  396. }