Explorar o código

fix(steamcmd): retries are not honored if install succeeds (#3155)

Christian %!s(int64=5) %!d(string=hai) anos
pai
achega
e9dbda748e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lgsm/functions/core_dl.sh

+ 2 - 1
lgsm/functions/core_dl.sh

@@ -87,8 +87,9 @@ fn_dl_steamcmd(){
 		fi
 
 		# Error checking for SteamCMD. Some errors will loop to try again and some will just exit.
+		# Check also if we have more errors than retries to be sure that we do not loop to many times and error out.
 		exitcode=$?
-		if [ -n "$(grep "Error!" "${steamcmdlog}" | tail -1)" ]||[ -n "$(grep "ERROR!" "${steamcmdlog}" | tail -1)" ]; then
+		if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then
 			# Not enough space.
 			if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then
 				fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files"