Browse Source

feat(bb): enhance BrainBread update process

* Updated `fn_update_dl` to use `remotebuildhash` for file integrity.
* Added handling for missing `remotebuildhash` to default to "nohash".
* Included `update_steamcmd.sh` call to ensure both Steam app and GitHub package updates are performed.

Co-authored-by: Copilot <[email protected]>
pull/4912/head
Daniel Gibbs 1 month ago
parent
commit
8444ad7b08
Failed to extract signature
  1. 2
      lgsm/modules/install_server_files.sh
  2. 11
      lgsm/modules/update_bb.sh

2
lgsm/modules/install_server_files.sh

@ -269,7 +269,7 @@ elif [ "${shortname}" == "xnt" ]; then
update_xnt.sh
elif [ "${shortname}" == "etl" ]; then
update_etl.sh
elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then
elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then
if [ "${shortname}" == "ut" ]; then
install_eula.sh
fi

11
lgsm/modules/update_bb.sh

@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_dl() {
# Download and extract files to serverfiles.
fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash"
fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}"
fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}"
echo "${remotebuild}" > "${serverfiles}/build.txt"
fn_clear_tmp
@ -37,7 +37,11 @@ fn_update_remotebuild() {
remotebuildresponse=$(curl -s "${apiurl}")
remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .name' | head -n 1)
remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .browser_download_url' | head -n 1)
remotebuildhash=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .digest' | sed 's/^sha256://g' | head -n 1)
remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name')
if [ -z "${remotebuildhash}" ] || [ "${remotebuildhash}" == "null" ]; then
remotebuildhash="nohash"
fi
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
@ -79,6 +83,7 @@ fn_update_compare() {
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildhash: ${remotebuildhash}"
fn_print_nl "* remotebuild: ${remotebuild}"
fi
fn_print "\n"
@ -145,6 +150,7 @@ fn_update_compare() {
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildhash: ${remotebuildhash}"
fn_print_nl "* remotebuild: ${remotebuild}"
fi
fi
@ -157,6 +163,9 @@ if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl
else
# BrainBread requires both Steam app updates and GitHub package updates.
update_steamcmd.sh
fn_print_dots "Checking for update"
fn_print_dots "Checking for update: ${remotelocation}"
fn_script_log_info "Checking for update: ${remotelocation}"

Loading…
Cancel
Save