Преглед изворни кода

fix(monitor): show the queried address on the DELAY and WAIT lines (#5006)

fn_monitor_query loops over queryips, but the DELAY print and log line
and the WAIT countdown still used ${ip}. With no IP set this is 0.0.0.0,
so monitor printed and logged an address it never queried.

Fixes #5004

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
BorzakA пре 1 недеља
родитељ
комит
5b099d54fa
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      lgsm/modules/command_monitor.sh

+ 3 - 3
lgsm/modules/command_monitor.sh

@@ -291,9 +291,9 @@ fn_monitor_query() {
 			fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING"
 			# querydelay
 			if [ "$(head -n 1 "${lockdir}/${selfname}-started.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then
-				fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}"
+				fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}"
 				fn_print_delay_eol_nl
-				fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY"
+				fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : DELAY"
 				fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago"
 				fn_script_log_info "Server started: $(date -d "@$(head -n 1 "${lockdir}/${selfname}-started.lock")")"
 				fn_script_log_info "Current time: $(date)"
@@ -364,7 +364,7 @@ fn_monitor_query() {
 		done
 		# Second counter will wait for 15s before breaking loop.
 		for seconds in {1..15}; do
-			fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}"
+			fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}"
 			fn_print_wait_eol
 			fn_sleep_time_1
 			totalseconds=$((totalseconds + 1))