Jelajahi Sumber

feat: monitor will now force an update if source servers request it

Daniel Gibbs 2 tahun lalu
induk
melakukan
c51734f595
2 mengubah file dengan 17 tambahan dan 4 penghapusan
  1. 14 1
      lgsm/modules/alert.sh
  2. 3 3
      lgsm/modules/command_monitor.sh

+ 14 - 1
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

+ 3 - 3
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