Browse Source

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
pull/575/head
Daniel Gibbs 9 years ago
parent
commit
eec7cdb2ed
  1. 9
      functions/fn_check_steamcmd
  2. 5
      functions/fn_install_serverfiles
  3. 5
      functions/fn_install_steamcmd

9
functions/fn_check_steamcmd

@ -34,5 +34,12 @@ elif [ "${modulename}" == "Starting" ]||[ "${modulename}" == "Update" ]||[ "${mo
tar --verbose -zxf "${steamcmddir}/steamcmd_linux.tar.gz" -C "${steamcmddir}" tar --verbose -zxf "${steamcmddir}/steamcmd_linux.tar.gz" -C "${steamcmddir}"
rm -v "${steamcmddir}/steamcmd_linux.tar.gz" rm -v "${steamcmddir}/steamcmd_linux.tar.gz"
chmod +x "${steamcmddir}/steamcmd.sh" 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 fi

5
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 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)) counter=$((counter+1))
cd "${rootdir}/steamcmd" 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 if [ "${counter}" -le "10" ]; then
# Attempt 1-4: Standard attempt # Attempt 1-4: Standard attempt
# Attempt 5-6: Validate attempt # Attempt 5-6: Validate attempt
@ -76,7 +72,6 @@ echo "Installing ${gamename} Server"
echo "=================================" echo "================================="
sleep 1 sleep 1
mkdir -pv "${filesdir}" mkdir -pv "${filesdir}"
cd "${rootdir}/steamcmd"
fn_steaminstallcommand fn_steaminstallcommand
if [ -z "${autoinstall}" ]; then if [ -z "${autoinstall}" ]; then
echo "" echo ""

5
functions/fn_install_steamcmd

@ -31,4 +31,9 @@ if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then
else else
echo "SteamCMD already installed!" echo "SteamCMD already installed!"
fi 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 sleep 1

Loading…
Cancel
Save