|
|
@@ -68,114 +68,13 @@ fn_install_server_files(){
|
|
|
fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}"
|
|
|
}
|
|
|
|
|
|
-fn_install_server_files_steamcmd(){
|
|
|
- counter="0"
|
|
|
- while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do
|
|
|
- counter=$((counter+1))
|
|
|
- if [ -d "${steamcmddir}" ]; then
|
|
|
- cd "${steamcmddir}" || exit
|
|
|
- fi
|
|
|
- if [ "${counter}" -le "10" ]; then
|
|
|
- # Attempt 1-4: Standard attempt.
|
|
|
- # Attempt 5-6: Validate attempt.
|
|
|
- # Attempt 7-8: Validate, delete long name dir.
|
|
|
- # Attempt 9-10: Validate, delete long name dir, re-download SteamCMD.
|
|
|
- # Attempt 11: Failure.
|
|
|
-
|
|
|
- if [ "${counter}" -ge "2" ]; then
|
|
|
- fn_print_warning_nl "SteamCMD did not complete the download, retrying: Attempt ${counter}"
|
|
|
- fn_script_log "SteamCMD did not complete the download, retrying: Attempt ${counter}"
|
|
|
- fi
|
|
|
-
|
|
|
- if [ "${counter}" -ge "7" ]; then
|
|
|
- echo -e "Removing $(find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$')"
|
|
|
- find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf
|
|
|
- fi
|
|
|
- if [ "${counter}" -ge "9" ]; then
|
|
|
- rm -rf "${steamcmddir:?}"
|
|
|
- check_steamcmd.sh
|
|
|
- fi
|
|
|
-
|
|
|
- # Detects if unbuffer command is available for 32 bit distributions only.
|
|
|
- info_distro.sh
|
|
|
- if [ "$(command -v stdbuf 2>/dev/null)" ]&&[ "${arch}" != "x86_64" ]; then
|
|
|
- unbuffer="stdbuf -i0 -o0 -e0"
|
|
|
- fi
|
|
|
-
|
|
|
- if [ "${counter}" -le "4" ]; then
|
|
|
- # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
|
|
|
- if [ "${appid}" == "90" ]; then
|
|
|
- # If using a specific branch.
|
|
|
- if [ -n "${branch}" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit
|
|
|
- else
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit
|
|
|
- fi
|
|
|
- elif [ "${shortname}" == "ac" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit
|
|
|
- # All other servers.
|
|
|
- else
|
|
|
- if [ -n "${branch}" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update -beta "${branch}" +quit
|
|
|
- else
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit
|
|
|
- fi
|
|
|
- fi
|
|
|
- local exitcode=$?
|
|
|
- elif [ "${counter}" -ge "5" ]; then
|
|
|
- # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
|
|
|
- if [ "${appid}" == "90" ]; then
|
|
|
- # If using a specific branch.
|
|
|
- if [ -n "${branch}" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" validate +quit
|
|
|
- else
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" validate +quit
|
|
|
- fi
|
|
|
- local exitcode=$?
|
|
|
- elif [ "${shortname}" == "ac" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit
|
|
|
- local exitcode=$?
|
|
|
- # All other servers.
|
|
|
- else
|
|
|
- if [ -n "${branch}" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit
|
|
|
- else
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit
|
|
|
- fi
|
|
|
- local exitcode=$?
|
|
|
- fi
|
|
|
- fi
|
|
|
- elif [ "${counter}" -ge "11" ]; then
|
|
|
- fn_print_failure_nl "SteamCMD did not complete the download, too many retrys"
|
|
|
- fn_script_log "SteamCMD did not complete the download, too many retrys"
|
|
|
- break
|
|
|
- fi
|
|
|
- done
|
|
|
-
|
|
|
- # GoldSrc (appid 90) servers commonly fail to download all the server files required.
|
|
|
- # Validating a few of times may reduce the chance of this issue.
|
|
|
- if [ "${appid}" == "90" ]; then
|
|
|
- fn_print_information_nl "GoldSrc servers commonly fail to download all the server files required. Validating a few of times may reduce the chance of this issue."
|
|
|
- counter="0"
|
|
|
- while [ "${counter}" -le "4" ]; do
|
|
|
- counter=$((counter+1))
|
|
|
- if [ -n "${branch}" ]; then
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" validate +quit
|
|
|
- else
|
|
|
- ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" validate +quit
|
|
|
- fi
|
|
|
- local exitcode=$?
|
|
|
- done
|
|
|
- fi
|
|
|
-}
|
|
|
-
|
|
|
echo -e ""
|
|
|
echo -e "${lightyellow}Installing ${gamename} Server${default}"
|
|
|
echo -e "================================="
|
|
|
fn_sleep_time
|
|
|
|
|
|
if [ "${appid}" ]; then
|
|
|
- fn_install_server_files_steamcmd
|
|
|
+ fn_dl_steamcmd
|
|
|
fi
|
|
|
|
|
|
if [ "${shortname}" == "ts3" ]; then
|