From 090d247dcb87fea2a4b97ba52424494ba4b427a1 Mon Sep 17 00:00:00 2001 From: DrCox1911 Date: Sun, 24 Apr 2016 00:54:14 +0200 Subject: [PATCH] Steam branch handling added Added ability to handle steam branches, needs my other changes to install_serverfiles and gameserverscript as well. --- functions/update_check.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/functions/update_check.sh b/functions/update_check.sh index 4c631657e..0e2a3a40d 100644 --- a/functions/update_check.sh +++ b/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"