diff --git a/inc/status.inc b/inc/status.inc index 3ceecc6d..0ed6abb1 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -820,6 +820,7 @@ STATUS_SCANTIMES(){ lastscantime=$(tail -n 1 ${NM_LOGFOLDER}/status-check.scantimes) lastscantime=${lastscantime#*~} scantimes=$(tail -n ${LAST} ${NM_LOGFOLDER}/status-check.scantimes) + longest_scantime=0 IFS=$'\n' read -rd '' -a scantimes <<<"${scantimes}" unset IFS @@ -828,6 +829,7 @@ STATUS_SCANTIMES(){ scantimes_total_xtr=0; scansfound_xtr=0 for scantime in "${scantimes[@]}"; do [[ "${scantime}" = *"~"* ]] && scantime=${scantime#*~} + [ ${scantime} -gt ${longest_scantime} ] && longest_scantime=${scantime} if [ ${scantime} -le 35 ]; then scantimes_total_norm=$(bc <<< "scale=2; ${scantimes_total_norm}+${scantime}") ((scansfound_norm++)) @@ -861,6 +863,8 @@ STATUS_SCANTIMES(){ lastscantime_disp=$(SHOW_TIME ${lastscantime} s) c=0; spcb=''; spc1=`expr ${cw} - ${#lastscantime}`; until [ $c = ${spc1} ]; do spcb="${spcb} "; c=`expr $c + 1`; done + longest_scantime_disp=$(SHOW_TIME ${longest_scantime} s) + c=0; spcl=''; spc1=`expr ${cw} - ${#longest_scantime}`; until [ $c = ${spc1} ]; do spcl="${spcl} "; c=`expr $c + 1`; done [ -f ${NM_TMPFOLDER}/.replcheck ] && last_replcheck=$(date -d @$(stat -c %Y ${NM_TMPFOLDER}/.replcheck) "+%Y-%m-%d %H:%M:%S") || last_replcheck="" @@ -875,9 +879,11 @@ STATUS_SCANTIMES(){ echo -e "${idsCL[Cyan]} - w/Replication `IDS_NUMBER_FORMAT ${scansfound_repl}` ${idsCL[LightCyan]}(${average_repl}s)${spcr}${idsCL[Cyan]}${average_repl_disp}${idsCL[Default]}" echo -e "${idsCL[Cyan]} - Extreme runs `IDS_NUMBER_FORMAT ${scansfound_xtr}` ${idsCL[LightCyan]}(${average_xtr}s)${spcx}${idsCL[Cyan]}${average_xtr_disp}${idsCL[Default]}" echo - echo -e "${idsCL[LightCyan]}Last Scan Time : ${idsCL[LightGreen]}(${lastscantime}s)${spcb}${idsCL[Green]}${lastscantime_disp}${idsCL[Default]}\n" - echo -e "${idsCL[LightCyan]}Last Scan Check : ${idsCL[LightGreen]}${last_scancheck}${idsCL[Default]}\n" - echo -e "${idsCL[LightCyan]}Last Replication Check : ${idsCL[LightGreen]}${last_replcheck}${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Longest scan from above : ${idsCL[LightGreen]}(${longest_scantime}s)${spcl}${idsCL[Green]}${lastscantime_disp}${idsCL[Default]}" + echo + echo -e "${idsCL[LightCyan]}Last Scan Time : ${idsCL[LightGreen]}(${lastscantime}s)${spcb}${idsCL[Green]}${lastscantime_disp}${idsCL[Default]}" + 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]}"