Browse Source

fix(validate): resolve validate not functioning for non branch (#2802)

pull/2813/head
Daniel Gibbs 5 years ago
committed by GitHub
parent
commit
390fc23265
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      lgsm/functions/command_validate.sh
  2. 2
      lgsm/functions/info_messages.sh
  3. 47
      lgsm/functions/install_server_files.sh
  4. 16
      lgsm/functions/update_steamcmd.sh

16
lgsm/functions/command_validate.sh

@ -25,17 +25,27 @@ fn_validate(){
if [ -d "${steamcmddir}" ]; then if [ -d "${steamcmddir}" ]; then
cd "${steamcmddir}" || exit cd "${steamcmddir}" || exit
fi fi
# Detects if unbuffer command is available for 32 bit distributions only. # Detects if unbuffer command is available, for 32 bit distributions only.
info_distro.sh info_distro.sh
if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then
unbuffer="stdbuf -i0 -o0 -e0" unbuffer="stdbuf -i0 -o0 -e0"
fi fi
# If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
if [ "${appid}" == "90" ]; then if [ "${appid}" == "90" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" # If using a specific branch.
else if [ -n "${branch}" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}"
else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" validate +quit | tee -a "${lgsmlog}"
fi
# All other servers.
elif [ -n "${branch}" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}"
else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit | tee -a "${lgsmlog}"
fi fi
exitcode=$? exitcode=$?
fn_print_dots "Validating server: SteamCMD" fn_print_dots "Validating server: SteamCMD"
if [ "${exitcode}" != "0" ]; then if [ "${exitcode}" != "0" ]; then

2
lgsm/functions/info_messages.sh

@ -186,7 +186,7 @@ fn_info_message_gameserver(){
fi fi
# Branch # Branch
if [ "${branch}" ]; then if [ -n "${branch}" ]; then
echo -e "${lightblue}Branch:\t${default}${branch}" echo -e "${lightblue}Branch:\t${default}${branch}"
fi fi

47
lgsm/functions/install_server_files.sh

@ -105,19 +105,40 @@ fn_install_server_files_steamcmd(){
fi fi
if [ "${counter}" -le "4" ]; then if [ "${counter}" -le "4" ]; then
# If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
if [ "${appid}" == "90" ]; then if [ "${appid}" == "90" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit # If using a specific branch.
local exitcode=$? 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
# All other servers.
else else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit if [ -n "${branch}" ]; then
local exitcode=$? ${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 fi
local exitcode=$?
elif [ "${counter}" -ge "5" ]; then elif [ "${counter}" -ge "5" ]; then
if [ "${engine}" == "goldsrc" ]; then # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" validate +quit 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=$? local exitcode=$?
# All other servers.
else else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit 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=$? local exitcode=$?
fi fi
fi fi
@ -128,14 +149,18 @@ fn_install_server_files_steamcmd(){
fi fi
done done
# GoldSrc servers commonly fail to download all the server files required. # 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. # Validating a few of times may reduce the chance of this issue.
if [ "${engine}" == "goldsrc" ]; then 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." 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" counter="0"
while [ "${counter}" -le "4" ]; do while [ "${counter}" -le "4" ]; do
counter=$((counter+1)) counter=$((counter+1))
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" validate +quit 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=$? local exitcode=$?
done done
fi fi

16
lgsm/functions/update_steamcmd.sh

@ -18,10 +18,22 @@ fn_update_steamcmd_dl(){
if [ -d "${steamcmddir}" ]; then if [ -d "${steamcmddir}" ]; then
cd "${steamcmddir}" || exit cd "${steamcmddir}" || exit
fi fi
# If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
if [ "${appid}" == "90" ]; then if [ "${appid}" == "90" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" # 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 | tee -a "${lgsmlog}"
else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit | tee -a "${lgsmlog}"
fi
# All other servers.
else else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" if [ -n "${branch}" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}"
else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit | tee -a "${lgsmlog}"
fi
fi fi
fix.sh fix.sh
} }

Loading…
Cancel
Save