From 6716839c8bb5e43d999c50488bf996bf67f73896 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Jul 2023 21:42:59 +0100 Subject: [PATCH] feat: add steamcmd checking to monitor --- lgsm/functions/check.sh | 10 +++++----- lgsm/modules/command_monitor.sh | 9 +++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 0f1e12368..e19853424 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -31,7 +31,7 @@ if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && check_system_dir.sh fi -allowed_commands_array=(START DEBUG) +allowed_commands_array=(DEBUG START) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_executable.sh @@ -47,7 +47,7 @@ if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then done fi -allowed_commands_array=(BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPE) +allowed_commands_array=(BACKUP CHANGE-PASSWORD CONSOLE DEBUG DETAILS FASTDL MAP-COMPRESSOR MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT UPDATE UPDATE-LGSM VALIDATE WIPE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_logs.sh @@ -68,7 +68,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS) +allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST-DETAILS START STOP) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ -z "${installflag}" ]; then @@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +allowed_commands_array=(CHECK-UPDATE DEBUG MONITOR START UPDATE VALIDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ "${appid}" ]; then @@ -86,7 +86,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR POST-DETAILS START STOP UPDATE VALIDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_status.sh diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 7899a5c34..bdb7a933b 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -72,13 +72,10 @@ fn_monitor_check_update() { # Monitor will check if an update is running. if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update - if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then - fn_print_dots "Checking active updates: " - fn_print_checking_eol - fn_script_log_info "Checking active updates: CHECKING" - fn_print_info_nl "Checking active updates: SteamCMD is currently checking for updates: " + if [ "$(pgrep -fc "n*${selfname} update")" == "0" ]; then + fn_print_info_nl "Checking lockfile: LinuxGSM is currently checking for updates: " fn_print_info_eol - fn_script_log_pass "Checking active updates: SteamCMD is currently checking for updates" + fn_script_log_pass "Checking lockfile: LinuxGSM is currently checking for updates" core_exit.sh fi fi