From 753eb2a99a68fb4561f544c9017315498626cdcd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 25 Sep 2023 19:03:36 +0100 Subject: [PATCH 1/5] feat: moved last-updated.lock file moved last-updated.lock to ensure it doesn't force a reboot on monitor --- lgsm/modules/update_fctr.sh | 2 +- lgsm/modules/update_mc.sh | 2 +- lgsm/modules/update_mcb.sh | 2 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_ut99.sh | 2 +- lgsm/modules/update_vints.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index 4cbcdbefc8..9b88fcd170 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -93,6 +93,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. @@ -120,7 +121,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" diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index d65ee75635..2f7381da78 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -105,6 +105,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. @@ -132,7 +133,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" diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index ceb284b397..f3a802e9e4 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -111,6 +111,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. @@ -138,7 +139,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" diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 56d36a09b0..2ad6b91abc 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -115,6 +115,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. @@ -142,7 +143,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" diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index 1ff84a0600..c1dc1dade5 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -91,6 +91,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. @@ -118,7 +119,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" diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index d545a9c839..47195b9b20 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -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" From 4a02dfd382fba689e6a01fa78e33f35d278022ae Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 25 Sep 2023 20:30:40 +0100 Subject: [PATCH 2/5] fix: set $USER if missing $USER is not available in sh which is used by cron. --- lgsm/modules/core_modules.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 825a0a0ab0..c860d3eae7 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -816,6 +816,11 @@ if [ ! -d "${lockdir}" ]; then mkdir -p "${lockdir}" fi +# if $USER id missing set to whoami +if [ -z "${USER}" ]; then + USER="$(whoami)" +fi + # Calls on-screen messages (bootstrap) core_messages.sh From 13c62431d01ae72eef060baabf631d27799329f4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Sep 2023 00:30:54 +0100 Subject: [PATCH 3/5] refactor: improve log file display in info_messages.sh The code change modifies the tail command in the fn_info_logs function to exclude lines containing "==>". This improves the display of log files by filtering out unnecessary information. --- lgsm/config-default/config-lgsm/pvrserver/_default.cfg | 1 - lgsm/modules/info_messages.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 0a0bf8b525..5063868b0e 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -11,7 +11,6 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" - # Maps: bridge, datacenter, sand defaultmap="datacenter" # Get an API key from https://pavlov-ms.vankrupt.com/servers/v1/key diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 6d8b849c53..a05da414f4 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -762,7 +762,7 @@ fn_info_logs() { else echo -e "${gamelogdir}" # dos2unix sed 's/\r//' - tail "${gamelogdir}"/* 2> /dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 + tail "${gamelogdir}"/* 2> /dev/null | grep -av "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 fi echo -e "" fi From 2297d362a3754556975d87444df7c586074198fd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Sep 2023 00:35:22 +0100 Subject: [PATCH 4/5] feat: moved last-updated.lock file --- lgsm/modules/update_ts3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 40b299336e..bb137a0b30 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -97,6 +97,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. @@ -124,7 +125,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" From 107d48ee01c18ceee12784d36e4772c38d4dbb41 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Sep 2023 09:56:01 +0100 Subject: [PATCH 5/5] Release v23.5.3 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 525c45d871..c0195b2499 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.2" +modulesversion="v23.5.3" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index c860d3eae7..d03102ef51 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.2" +modulesversion="v23.5.3" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index a72f6ca932..6da7de6641 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.2" +version="v23.5.3" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 9b77dbed96..a63023dc8a 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.2" +version="v23.5.3" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 70e23aaf73..b921de2749 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.2" +version="v23.5.3" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index a49190e033..d173c7d680 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.2" +version="v23.5.3" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index f79fa5a5f2..7363a10254 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.2" +version="v23.5.3" shortname="ts3" gameservername="ts3server" commandname="CORE"