Skip to content

Commit c51734f

Browse files
committed
feat: monitor will now force an update if source servers request it
1 parent f33bfdf commit c51734f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

lgsm/modules/alert.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,20 @@ fn_alert_update() {
107107
alertcolourdec="52480"
108108
}
109109

110+
fn_alert_update_request() {
111+
fn_script_log_info "Sending alert: ${selfname} has requested an update and needs to be restarted."
112+
alertaction="Updating"
113+
alertemoji="🎉"
114+
alertsound="1"
115+
alertmessage="${selfname} has requested an update and needs to be restarted."
116+
# Blue
117+
alertcolourhex="#1e90ff"
118+
alertcolourdec="2003199"
119+
}
120+
110121
fn_alert_check_update() {
111122
fn_script_log_info "Sending alert: ${gamename} update available: ${remotebuildversion}"
112-
alertaction="Checked for Update"
123+
alertaction="Update available"
113124
alertemoji="🎉"
114125
alertsound="1"
115126
alertmessage="${gamename} update available: ${remotebuildversion}"
@@ -199,6 +210,8 @@ elif [ "${alert}" == "test" ]; then
199210
fn_alert_test
200211
elif [ "${alert}" == "update" ]; then
201212
fn_alert_update
213+
elif [ "${alert}" == "update-request" ]; then
214+
fn_alert_update_request
202215
elif [ "${alert}" == "check-update" ]; then
203216
fn_alert_check_update
204217
elif [ "${alert}" == "config" ]; then

lgsm/modules/command_monitor.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ fn_monitor_check_update_source() {
153153
fn_script_log_info "Checking update: CHECKING"
154154
fn_print_ok "Checking update: "
155155
fn_print_ok_eol_nl
156-
fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update"
157-
alert="update"
156+
fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted"
157+
alert="update-request"
158158
alert.sh
159-
command_restart.sh
159+
command_update.sh
160160
core_exit.sh
161161
fi
162162
fi

0 commit comments

Comments
 (0)