From e4ec9f2076eae441a0c781eb76e1ede586469f9a Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 27 Dec 2023 12:01:31 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index 58178430..a7c50e82 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -819,7 +819,7 @@ STATUS_SCANTIMES(){ echo -en "${idsCL[Yellow]}Pulling data and calculating average scan times for the last '${LAST}' scans ... " lastscantime=$(tail -n 1 ${NM_LOGFOLDER}/status-check.scantimes) - lastscantime=${lastscantime#*~} + lastscantime=$(echo "${lastscantime}" | cut -d '~' -f 2) scantimes=$(tail -n ${LAST} ${NM_LOGFOLDER}/status-check.scantimes) longest_scantime=0 IFS=$'\n' @@ -832,7 +832,10 @@ STATUS_SCANTIMES(){ for scan in "${scantimes[@]}"; do scantime=$(echo "${scan}" | cut -d '~' -f 2) scanrun=$(echo "${scan}" | cut -d '~' -f 3) - [ ${scantime} -gt ${longest_scantime} ] && longest_scantime=${scantime} + if [ ${scantime} -gt ${longest_scantime} ]; then + longest_scantime=${scantime} + longest_scandate=$(echo "${scan}" | cut -d '~' -f 1) + fi if [ ${scanrun} -eq 1 ]; then if [ ${scantime} -le 90 ]; then @@ -899,7 +902,8 @@ STATUS_SCANTIMES(){ echo -e "${idsCL[Cyan]} - Normal `IDS_NUMBER_FORMAT ${scansfound_repl}` ${idsCL[Cyan]}(${average_repl}s)${spcARD}${idsCL[LightCyan]}${average_repl_disp}${idsCL[Default]}" echo -e "${idsCL[Cyan]} - Long `IDS_NUMBER_FORMAT ${scansfound_repl_xtr}` ${idsCL[Cyan]}(${average_repl_xtr}s)${spcARXD}${idsCL[LightCyan]}${average_repl_xtr_disp}${idsCL[Default]}" echo - echo -e "${idsCL[LightCyan]}Longest scan from above : ${idsCL[Green]}(${longest_scantime}s) ${idsCL[LightGreen]}${longest_scantime_disp}${idsCL[Default]}" + echo -e "${idsCL[LightCyan]}Longest Scan Time : ${idsCL[Green]}(${longest_scantime}s) ${idsCL[LightGreen]}${longest_scantime_disp}${idsCL[Default]}" + echo -e "${idsCL[LightCyan]}Longest Scan Date : ${idsCL[LightGreen]}${longest_scandate}${idsCL[Default]}" echo echo -e "${idsCL[LightCyan]}Last Scan Time : ${idsCL[Green]}(${lastscantime}s) ${idsCL[LightGreen]}${lastscantime_disp}${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Last Scan Check : ${idsCL[LightGreen]}${last_scancheck}${idsCL[Default]}"