瀏覽代碼

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
Daniel Gibbs 10 年之前
父節點
當前提交
eec7cdb2ed
共有 3 個文件被更改,包括 13 次插入6 次删除
  1. 8 1
      functions/fn_check_steamcmd
  2. 0 5
      functions/fn_install_serverfiles
  3. 5 0
      functions/fn_install_steamcmd

+ 8 - 1
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

+ 0 - 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
 	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 ""

+ 5 - 0
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