Browse Source

fix(core_dl): address baseappid download issues in steamcmd

- Move baseappid block before branch/betapassword checks so base app
  is always installed first when baseappid is set, regardless of
  whether branch/betapassword are also configured
- Capture PIPESTATUS[0] after base app download and continue the
  retry loop on failure, preventing a failed base app install from
  being masked by a successful main app install
- Add guard: fail with a clear message when baseappid is set but
  supportdir is empty/unset
pull/4898/head
Daniel Gibbs 2 months ago
parent
commit
b346e68fd5
Failed to extract signature
  1. 32
      lgsm/modules/core_dl.sh

32
lgsm/modules/core_dl.sh

@ -81,25 +81,45 @@ fn_dl_steamcmd() {
fi
# Force Windows Platform type.
elif [ "${steamcmdforcewindows}" == "yes" ]; then
# If a base app is required, install it first.
if [ -n "${baseappid}" ]; then
if [ -z "${supportdir}" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
core_exit.sh
fi
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
exitcode="${PIPESTATUS[0]}"
if [ "${exitcode}" -ne 0 ]; then
continue
fi
fi
if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
elif [ -n "${branch}" ]; then
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
elif [ -n "${baseappid}" ]; then
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
else
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
fi
# All other servers.
else
# If a base app is required, install it first.
if [ -n "${baseappid}" ]; then
if [ -z "${supportdir}" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
core_exit.sh
fi
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
exitcode="${PIPESTATUS[0]}"
if [ "${exitcode}" -ne 0 ]; then
continue
fi
fi
if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
elif [ -n "${branch}" ]; then
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
elif [ -n "${baseappid}" ]; then
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
else
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
fi

Loading…
Cancel
Save