diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 7ab280674..fb966d7e0 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -42,6 +42,9 @@ githubbranch="master" # Steam appid="380870" +# Allows for opting into the various Steam branches that PZ has to offer +# Example: -beta iwillbackupmysave -betapassword iaccepttheconsequences +branch="" # Server Details servicename="pz-server" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index e9a0eeac4..cf31e355c 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -49,7 +49,7 @@ fn_install_server_files_steamcmd(){ if [ "${counter}" -le "4" ]; then if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit local exitcode=$? else ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit @@ -57,7 +57,7 @@ fn_install_server_files_steamcmd(){ fi elif [ "${counter}" -ge "5" ]; then if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} -validate +quit local exitcode=$? else ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit diff --git a/lgsm/functions/update_check.sh b/lgsm/functions/update_check.sh index 191a07533..d39d8d688 100644 --- a/lgsm/functions/update_check.sh +++ b/lgsm/functions/update_check.sh @@ -121,7 +121,16 @@ fn_steamcmdcheck(){ 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_print_fail "Checking for update: SteamCMD" fn_scriptlog "Failure! Checking for update: SteamCMD"