From c51734f59548924f2aee749e19fbb33fd99f6b82 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 28 Oct 2023 08:52:07 +0100 Subject: [PATCH] feat: monitor will now force an update if source servers request it --- lgsm/modules/alert.sh | 15 ++++++++++++++- lgsm/modules/command_monitor.sh | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/alert.sh b/lgsm/modules/alert.sh index 4a34207e9..40288d234 100644 --- a/lgsm/modules/alert.sh +++ b/lgsm/modules/alert.sh @@ -107,9 +107,20 @@ fn_alert_update() { alertcolourdec="52480" } +fn_alert_update_request() { + fn_script_log_info "Sending alert: ${selfname} has requested an update and needs to be restarted." + alertaction="Updating" + alertemoji="🎉" + alertsound="1" + alertmessage="${selfname} has requested an update and needs to be restarted." + # Blue + alertcolourhex="#1e90ff" + alertcolourdec="2003199" +} + fn_alert_check_update() { fn_script_log_info "Sending alert: ${gamename} update available: ${remotebuildversion}" - alertaction="Checked for Update" + alertaction="Update available" alertemoji="🎉" alertsound="1" alertmessage="${gamename} update available: ${remotebuildversion}" @@ -199,6 +210,8 @@ elif [ "${alert}" == "test" ]; then fn_alert_test elif [ "${alert}" == "update" ]; then fn_alert_update +elif [ "${alert}" == "update-request" ]; then + fn_alert_update_request elif [ "${alert}" == "check-update" ]; then fn_alert_check_update elif [ "${alert}" == "config" ]; then diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 51a1e99bf..badc90510 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -153,10 +153,10 @@ fn_monitor_check_update_source() { fn_script_log_info "Checking update: CHECKING" fn_print_ok "Checking update: " fn_print_ok_eol_nl - fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update" - alert="update" + fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" + alert="update-request" alert.sh - command_restart.sh + command_update.sh core_exit.sh fi fi