Browse Source

a

pull/4146/head
Daniel Gibbs 3 years ago
parent
commit
6f5ed33c6a
  1. 1
      lgsm/functions/update_factorio.sh
  2. 1
      lgsm/functions/update_jediknight2.sh
  3. 1
      lgsm/functions/update_minecraft.sh
  4. 1
      lgsm/functions/update_minecraft_bedrock.sh
  5. 1
      lgsm/functions/update_mta.sh
  6. 1
      lgsm/functions/update_ts3.sh
  7. 17
      lgsm/functions/update_ut99.sh
  8. 27
      lgsm/functions/update_vintagestory.sh

1
lgsm/functions/update_factorio.sh

@ -98,6 +98,7 @@ fn_update_factorio_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi

1
lgsm/functions/update_jediknight2.sh

@ -90,6 +90,7 @@ fn_update_jk2_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi

1
lgsm/functions/update_minecraft.sh

@ -110,6 +110,7 @@ fn_update_minecraft_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi

1
lgsm/functions/update_minecraft_bedrock.sh

@ -103,6 +103,7 @@ fn_update_minecraft_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi

1
lgsm/functions/update_mta.sh

@ -98,6 +98,7 @@ fn_update_mta_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi

1
lgsm/functions/update_ts3.sh

@ -105,6 +105,7 @@ fn_update_ts3_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi

17
lgsm/functions/update_ut99.sh

@ -8,9 +8,6 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_ut99_dl() {
remotebuildurl=$(curl --connect-timeout 10 -sL "https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url')
remotebuildfilename=$(curl --connect-timeout 10 -sL "https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name')
fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "" "norun" "noforce" "nohash"
fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}"
echo "${remotebuild}" > "${serverfiles}/build.txt"
@ -33,12 +30,16 @@ fn_update_ut99_localbuild() {
}
fn_update_ut99_remotebuild() {
# Gets remote build info.
remotebuild=$(curl -s "https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" | jq -r '.tag_name')
# Get remote build info.
apiurl="https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest"
remotebuildresponse=$(curl -s "${apiurl}")
remotebuildfilename=$(echo -e "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name')
remotebuildurl=$(echo -e "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url')
remotebuildversion=$(echo -e "${remotebuildresponse}" | jq -r '.tag_name')
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then
# Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
@ -48,7 +49,7 @@ fn_update_ut99_remotebuild() {
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh

27
lgsm/functions/update_vintagestory.sh

@ -8,15 +8,9 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_vs_dl() {
# get version info for download
remotebuildresponse=$(curl -s "${apiurl}" | jq --arg version "${remotebuild}" '.[$version].server')
remotebuildfile=$(echo -e "${remotebuildresponse}" | jq -r '.filename')
remotebuildurl=$(echo -e "${remotebuildresponse}" | jq -r '.urls.cdn')
remotebuildmd5=$(echo -e "${remotebuildresponse}" | jq -r '.md5')
# Download and extract files to serverfiles
fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfile}" "nochmodx" "norun" "force" "${remotebuildmd5}"
fn_dl_extract "${tmpdir}" "${remotebuildfile}" "${serverfiles}"
fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildmd5}"
fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}"
fn_clear_tmp
}
@ -38,16 +32,21 @@ fn_update_vs_localbuild() {
}
fn_update_vs_remotebuild() {
apiurl="http://api.vintagestory.at/stable-unstable.json"
remotebuildresponse=$(curl -s "${apiurl}")
if [ "${branch}" == "stable" ]; then
remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1)
remotebuildversion=$(echo -e "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1)
else
remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1)
remotebuildversion=$(echo -e "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1)
fi
remotebuildfilename=$(echo -e "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.filename')
remotebuildurl=$(echo -e "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.filename')
remotebuildmd5=$(echo -e "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.filename')
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then
# Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
@ -57,7 +56,7 @@ fn_update_vs_remotebuild() {
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh
@ -94,6 +93,7 @@ fn_update_vs_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
command_stop.sh
fn_firstcommand_reset
fi
@ -137,7 +137,6 @@ fn_update_vs_compare() {
# The location where the builds are checked and downloaded.
remotelocation="vintagestory.at"
apiurl="http://api.${remotelocation}/stable-unstable.json"
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_vs_remotebuild

Loading…
Cancel
Save