diff --git a/functions/fn_check_steamcmd b/functions/fn_check_steamcmd index 9e94ac36f..d29e218b1 100644 --- a/functions/fn_check_steamcmd +++ b/functions/fn_check_steamcmd @@ -34,5 +34,12 @@ elif [ "${modulename}" == "Starting" ]||[ "${modulename}" == "Update" ]||[ "${mo tar --verbose -zxf "${steamcmddir}/steamcmd_linux.tar.gz" -C "${steamcmddir}" rm -v "${steamcmddir}/steamcmd_linux.tar.gz" chmod +x "${steamcmddir}/steamcmd.sh" - fi + fi + if [ "${modulename}" == "Update" ]||[ "${modulename}" == "Validate" ]; then + # Checks that steamcmd is working correctly and will prompt Steam Guard if required. + "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit + if [ $? -ne 0 ]; then + fn_printfailurenl "Error running SteamCMD" + fi + fi fi diff --git a/functions/fn_install_serverfiles b/functions/fn_install_serverfiles index 7df2e4097..295a586d1 100644 --- a/functions/fn_install_serverfiles +++ b/functions/fn_install_serverfiles @@ -10,10 +10,6 @@ counter="0" while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_install_serverfiles.tmp)" -ge "1" ]; do counter=$((counter+1)) cd "${rootdir}/steamcmd" - ./steamcmd.sh +quit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - fn_printfailurenl "Cannot start SteamCMD. Are dependencies installed?" - fi if [ "${counter}" -le "10" ]; then # Attempt 1-4: Standard attempt # Attempt 5-6: Validate attempt @@ -76,7 +72,6 @@ echo "Installing ${gamename} Server" echo "=================================" sleep 1 mkdir -pv "${filesdir}" -cd "${rootdir}/steamcmd" fn_steaminstallcommand if [ -z "${autoinstall}" ]; then echo "" diff --git a/functions/fn_install_steamcmd b/functions/fn_install_steamcmd index d62405545..8e7206f0d 100644 --- a/functions/fn_install_steamcmd +++ b/functions/fn_install_steamcmd @@ -31,4 +31,9 @@ if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then else echo "SteamCMD already installed!" fi + # Checks that steamcmd is working correctly and will prompt Steam Guard if required. + "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit + if [ $? -ne 0 ]; then + fn_printfailurenl "Error running SteamCMD" + fi sleep 1