From 022b63d35eb5d50175fbaa3ee339b4216e9bd1c7 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 27 Dec 2023 11:54:36 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index 7fe13048..4109e681 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -905,24 +905,20 @@ STATUS_SCANTIMES(){ echo -e "${idsCL[LightCyan]}Last Scan Check : ${idsCL[LightGreen]}${last_scancheck}${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Last Replication Check : ${idsCL[LightGreen]}${last_replcheck}${idsCL[Default]}" - if [ ${scansfound} -le 500 ]; then - echo -en "\n${idsCL[LightCyan]}List out these '${scansfound}' scan times? (y/N): ${idsCL[Default]}" + if [ ${scansfound_total} -le 500 ]; then + echo -en "\n${idsCL[LightCyan]}List out these '${scansfound_total}' scan times? (y/N): ${idsCL[Default]}" read -n1 choice if [ "${choice^^}" == "Y" ]; then echo -en "\r\033[K" - lastscansnum=${scansfound} + lastscansnum=${scansfound_total} last_scantimes=$(tail -n ${lastscansnum} ${NM_LOGFOLDER}/status-check.scantimes) IFS=$'\n' read -rd '' -a last_scantimes <<<"${last_scantimes}" unset IFS echo -e "${idsCL[LightCyan]}Last ${lastscansnum} Scan Times\n${idsCL[Green]}------------------------------------------${idsCL[Default]}" - for scantime in "${last_scantimes[@]}"; do - if [[ "${scantime}" = *"~"* ]]; then - dt="${scantime%~*}" - scantime=${scantime#*~} - else - dt=" " - fi + for scan in "${last_scantimes[@]}"; do + scantime=$(echo "${scan}" | cut -d '~' -f 2) + scanrun=$(echo "${scan}" | cut -d '~' -f 3) echo -en "${idsCL[White]} ${dt} (${scantime}s) ${idsCL[Yellow]}$(SHOW_TIME ${scantime} s) " if [ ${scantime} -ge 30 ] && [ ${scantime} -le 60 ]; then echo -e "<-- Replication Run${idsCL[Default]}"