Browse Source

feat: add steamcmd checking to monitor

pull/4257/head
Daniel Gibbs 2 years ago
parent
commit
6716839c8b
  1. 10
      lgsm/functions/check.sh
  2. 9
      lgsm/modules/command_monitor.sh

10
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

9
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

Loading…
Cancel
Save