From fac177b8f3c4c50a3619bc42934862e3f927cadb Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 6 Dec 2023 23:12:56 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index f04ef076..f1f1733e 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -801,7 +801,6 @@ STATUS_SCANTIMES(){ scantimes_total=0; scansfound=0 for scantime in "${scantimes[@]}"; do [[ "${scantime}" = *"~"* ]] && scantime=${scantime#*~} - echo ${scantime} scantimes_total=$(bc <<< "scale=2; ${scantimes_total}+${scantime}") ((scansfound++)) done @@ -810,12 +809,12 @@ STATUS_SCANTIMES(){ cw=8 average_disp=$(SHOW_TIME ${average} s); c=0; spca=''; spc1=`expr ${cw} - ${#average_disp}` until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done - lastscantime_disp=$(SHOW_TIME ${lastscantime} s); c=0; spcb=''; spc1=`expr ${cw} - ${#lastscantime_disp}` + lastscantime_disp=$(SHOW_TIME ${lastscantime#*~} s); c=0; spcb=''; spc1=`expr ${cw} - ${#lastscantime_disp}` until [ $c = ${spc1} ]; do spcb="${spcb} "; c=`expr $c + 1`; done echo -en "\r\033[K" echo -e "${idsCL[LightCyan]}Average for last '${scansfound}' : ${idsCL[LightGreen]}(${average}s)${spca}${idsCL[Green]}${average_disp}${idsCL[Default]}\n" - echo -e "${idsCL[LightCyan]}Last Scan Time : ${idsCL[LightGreen]}(${lastscantime}s)${spcb}${idsCL[Green]}${lastscantime_disp} ${idsCL[LightCyan]}- $(date -r ${NM_LOGFOLDER}/status-check.scantimes "+%m-%d-%Y %H:%M")${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Last Scan Time : ${idsCL[LightGreen]}(${lastscantime#*~}s)${spcb}${idsCL[Green]}${lastscantime_disp} ${idsCL[LightCyan]}- $(date -r ${NM_LOGFOLDER}/status-check.scantimes "+%m-%d-%Y %H:%M")${idsCL[Default]}\n" if [ ${scansfound} -le 500 ]; then echo -en "${idsCL[LightCyan]}List out these scan times? (y/N): ${idsCL[Default]}" @@ -826,7 +825,12 @@ STATUS_SCANTIMES(){ last_scantimes=($(tail -n ${lastscansnum} ${NM_LOGFOLDER}/status-check.scantimes)) echo -e "${idsCL[LightCyan]}Last ${lastscansnum} Scan Times\n${idsCL[Green]}---------------------------------${idsCL[Default]}" for scantime in "${last_scantimes[@]}"; do - [[ "${scantime}" = *"~"* ]] && dt=${scantime%~*} && scantime=${scantime#*~} + if [[ "${scantime}" = *"~"* ]]; then + dt=${scantime%~*} + scantime=${scantime#*~} + else + dt=" " + fi echo -e "${idsCL[White]} ${dt} $(SHOW_TIME ${scantime} s) (${scantime}s)${idsCL[Default]}" done fi