Browse Source

feat: refactor update comparison output for consistency and clarity

- Replaced direct echo statements with fn_print functions for uniformity in output formatting across multiple update scripts.
- Ensured lockfile creation uses the correct syntax for variable expansion.
- Moved lock file to the same location to ensure monitor doesnt reboot at the wrong time
- Updated remote build information display to enhance readability and maintain consistency in logging.
- Removed unnecessary echo commands to streamline the output process.
4696-bug-discord-alert-on-update-uses-the-old-version-not-the-new-one
Daniel Gibbs 1 week ago
parent
commit
cfa873c483
Failed to extract signature
  1. 2
      .shellcheckrc
  2. 1
      lgsm/modules/check_last_update.sh
  3. 2
      lgsm/modules/core_steamcmd.sh
  4. 46
      lgsm/modules/update_fctr.sh
  5. 54
      lgsm/modules/update_jk2.sh
  6. 52
      lgsm/modules/update_mc.sh
  7. 52
      lgsm/modules/update_mcb.sh
  8. 54
      lgsm/modules/update_mta.sh
  9. 52
      lgsm/modules/update_pmc.sh
  10. 52
      lgsm/modules/update_ts3.sh
  11. 52
      lgsm/modules/update_ut99.sh
  12. 53
      lgsm/modules/update_vints.sh
  13. 52
      lgsm/modules/update_xnt.sh

2
.shellcheckrc

@ -1 +1 @@
disable=SC2154
disable=SC2154,SC2034

1
lgsm/modules/check_last_update.sh

@ -11,6 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -f "${lockdir}/${selfname}-last-started.lock" ]; then
laststart=$(cat "${lockdir}/${selfname}-last-started.lock")
fi
if [ -f "${lockdir}/last-updated.lock" ]; then
lastupdate=$(cat "${lockdir}/last-updated.lock")
fi

2
lgsm/modules/core_steamcmd.sh

@ -239,6 +239,7 @@ fn_update_steamcmd_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -257,7 +258,6 @@ fn_update_steamcmd_compare() {
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir:?}/last-updated.lock"
alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update"

46
lgsm/modules/update_fctr.sh

@ -69,21 +69,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}"
echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild} ${factorioarch}"
fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}"
@ -93,7 +93,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -128,14 +128,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}"
echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild} ${factorioarch}"
fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}"
@ -143,11 +143,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}

54
lgsm/modules/update_jk2.sh

@ -66,21 +66,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -90,6 +90,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -117,7 +118,6 @@ fn_update_compare() {
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/last-updated.lock"
alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update"
@ -125,14 +125,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -140,23 +140,17 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
# The location where the builds are checked and downloaded.
remotelocation="github.com"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
remotelocation="factorio.com"
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild

52
lgsm/modules/update_mc.sh

@ -81,21 +81,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -105,7 +105,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -140,14 +140,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -155,11 +155,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -167,12 +167,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="mojang.com"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

52
lgsm/modules/update_mcb.sh

@ -92,21 +92,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -116,7 +116,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -151,14 +151,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -166,11 +166,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -178,12 +178,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="minecraft.net"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

54
lgsm/modules/update_mta.sh

@ -39,7 +39,7 @@ fn_update_remotebuild() {
remotebuildresponse=$(curl -s "${apiurl}")
remotebuildfilename="multitheftauto_linux_x64.tar.gz"
remotebuildurl="http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz"
remotebuildversion=$(echo "${remotebuildresponse}")
remotebuildversion="${remotebuildresponse}"
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuildversion variable has been set.
@ -74,21 +74,21 @@ fn_update_compare() {
mtaupdatestatus="available"
fi
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -98,6 +98,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -125,7 +126,6 @@ fn_update_compare() {
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/last-updated.lock"
alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update"
@ -133,14 +133,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -148,11 +148,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -160,12 +160,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="linux.mtasa.com"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

52
lgsm/modules/update_pmc.sh

@ -91,21 +91,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -115,7 +115,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -150,14 +150,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -165,11 +165,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -177,12 +177,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="papermc.io"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${shortname}" == "pmc" ]; then
paperproject="paper"
elif [ "${shortname}" == "vpmc" ]; then

52
lgsm/modules/update_ts3.sh

@ -73,21 +73,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -97,7 +97,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -132,14 +132,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -147,11 +147,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -171,12 +171,6 @@ fi
# The location where the builds are checked and downloaded.
remotelocation="teamspeak.com"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

52
lgsm/modules/update_ut99.sh

@ -67,21 +67,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -91,7 +91,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -126,14 +126,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -141,11 +141,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -153,12 +153,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="github.com"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

53
lgsm/modules/update_vints.sh

@ -20,6 +20,7 @@ fn_update_localbuild() {
# Uses executable to get local build.
if [ -d "${executabledir}" ]; then
cd "${executabledir}" || exit
# shellcheck disable=SC2086 # Intentional: preexecutable may be empty; unquoted to drop it without producing an empty arg.
localbuild="$(${preexecutable} ${executable} --version 2> /dev/null | sed '/^[[:space:]]*$/d')"
fi
if [ -z "${localbuild}" ]; then
@ -74,21 +75,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -98,7 +99,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -133,14 +134,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -148,11 +149,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -160,12 +161,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="vintagestory.at"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

52
lgsm/modules/update_xnt.sh

@ -85,21 +85,21 @@ fn_update_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -109,7 +109,7 @@ fn_update_compare() {
fn_script_log_info "${localbuild} > ${remotebuildversion}"
if [ "${commandname}" == "UPDATE" ]; then
date +%s > "${lockdir}/last-updated.lock"
date +%s > "${lockdir:?}/last-updated.lock"
unset updateonstart
check_status.sh
# If server stopped.
@ -144,14 +144,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -159,11 +159,11 @@ fn_update_compare() {
fn_script_log_info "Branch: ${branch}"
fi
if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "Remote build info"
echo -e "* apiurl: ${apiurl}"
echo -e "* remotebuildfilename: ${remotebuildfilename}"
echo -e "* remotebuildurl: ${remotebuildurl}"
echo -e "* remotebuildversion: ${remotebuildversion}"
fn_print_nl "Remote build info"
fn_print_nl "* apiurl: ${apiurl}"
fn_print_nl "* remotebuildfilename: ${remotebuildfilename}"
fn_print_nl "* remotebuildurl: ${remotebuildurl}"
fn_print_nl "* remotebuildversion: ${remotebuildversion}"
fi
fi
}
@ -171,12 +171,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="github.com"
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

Loading…
Cancel
Save