Explorar el Código

added timeout of 10 seconds

Discovered issue with steamCMD sometimes getting stuck for an unknown
reason. Causing the update command not to ever finish. I have added a
timeout of 10 seconds so should it fail it will quit the updater.
Daniel Gibbs hace 10 años
padre
commit
219cecc3e6
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lgsm/functions/update_steamcmd.sh

+ 1 - 1
lgsm/functions/update_steamcmd.sh

@@ -154,7 +154,7 @@ fn_update_steamcmd_check(){
 	fi
 
 	# Gets availablebuild info
-	availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
+	availablebuild=$(timeout 10s ./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit; sleep 10 | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
 	if [ -z "${availablebuild}" ]; then
 		fn_print_fail "Checking for update: SteamCMD"
 		sleep 1