Procházet zdrojové kódy

Steam branch handling added

Added ability to handle steam branches, needs my other changes to install_serverfiles and gameserverscript as well.
DrCox1911 před 10 roky
rodič
revize
090d247dcb
1 změnil soubory, kde provedl 10 přidání a 1 odebrání
  1. 10 1
      functions/update_check.sh

+ 10 - 1
functions/update_check.sh

@@ -120,7 +120,16 @@ cd "${rootdir}/steamcmd"
 if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then
 	rm -f "${HOME}/Steam/appcache/appinfo.vdf"
 fi
-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+\"public\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
+
+# set branch for updateinfo
+IFS=' ' read -a branchsplits <<< "${branch}"
+if [ "${#branchsplits[@]}" -gt 1 ]; then
+        branchname="${branchsplits[1]}"
+else
+        branchname="public"
+fi
+
+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)
 if [ -z "${availablebuild}" ]; then
 	fn_printfail "Checking for update: SteamCMD"
 	fn_scriptlog "Failure! Checking for update: SteamCMD"