From 9254d820b0144d9d2199c6cc8d76bbc1780daae7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 5 Dec 2020 11:17:14 +0000 Subject: [PATCH] fix(monitor):correct monitor not picking up date from lock file --- lgsm/functions/command_monitor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 28cc70fab..edc101012 100755 --- a/lgsm/functions/command_monitor.sh +++ b/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