Sfoglia il codice sorgente

fix(monitor):correct monitor not picking up date from lock file

Daniel Gibbs 5 anni fa
parent
commit
9254d820b0
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      lgsm/functions/command_monitor.sh

+ 2 - 2
lgsm/functions/command_monitor.sh

@@ -108,12 +108,12 @@ for queryattempt in {1..5}; do
 		fn_print_querying_eol
 		fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING"
 		# querydelay
-		if [ "$(cat "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then
+		if [ "$(head -n 1 "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then
 			fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
 			fn_print_delay_eol_nl
 			fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY"
 			fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago"
-			fn_script_log_info "Server started: $(date -d @$(cat "${lockdir}/${selfname}.lock"))"
+			fn_script_log_info "Server started: $(date -d @$(head -n 1 "${lockdir}/${selfname}.lock"))"
 			fn_script_log_info "Current time: $(date)"
 			monitorpass=1
 			core_exit.sh