From eec7cdb2ede75b79be6483623b499cb3d4cdccdc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 20 Dec 2015 21:15:00 +0000 Subject: [PATCH] SteamCMD will now run once before updates SteamCMD will run before updates once to ensure that it works. This will make sure that if steamguard is required it will list the code. Also if dependencies are missing it will also fail. if failure script will exit --- functions/fn_check_steamcmd | 9 ++++++++- functions/fn_install_serverfiles | 5 ----- functions/fn_install_steamcmd | 5 +++++ 3 files changed, 13 insertions(+), 6 deletions(-) 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