diff --git a/inc/status.inc b/inc/status.inc index 308584a2..edba28aa 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -838,20 +838,38 @@ STATUS_SCANTIMES(){ ((scansfound_xtr++)) fi done + + scantimes_total=`expr ${scantimes_total_norm} + ${scantimes_total_repl} + ${scantimes_total_xtr}` + scansfound=`expr ${scansfound_norm} + ${scansfound_repl} + ${scansfound_xtr}` + average_norm=$(ROUND_NUMBER $(bc <<< "scale=2; ${scantimes_total_norm}/${scansfound_norm}") 0) + average_repl=$(ROUND_NUMBER $(bc <<< "scale=2; ${scantimes_total_repl}/${scansfound_repl}") 0) + average_xtr=$(ROUND_NUMBER $(bc <<< "scale=2; ${scantimes_total_xtr}/${scansfound_xtr}") 0) + average=$(ROUND_NUMBER $(bc <<< "scale=2; ${scantimes_total}/${scansfound}") 0) + cw=8 - average_norm_disp=$(SHOW_TIME ${average_norm} s); c=0; spca=''; spc1=`expr ${cw} - ${#average_norm_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}` - until [ $c = ${spc1} ]; do spcb="${spcb} "; c=`expr $c + 1`; done + average_norm_disp=$(SHOW_TIME ${average_norm} s) + c=0; spca=''; spc1=`expr ${cw} - ${#average_norm_disp}`; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done + average_repl_disp=$(SHOW_TIME ${average_repl} s) + c=0; spcr=''; spc1=`expr ${cw} - ${#average_repl_disp}`; until [ $c = ${spc1} ]; do spcr="${spcr} "; c=`expr $c + 1`; done + average_xtr_disp=$(SHOW_TIME ${average_xtr} s) + c=0; spcx=''; spc1=`expr ${cw} - ${#average_xtr_disp}`; until [ $c = ${spc1} ]; do spcx="${spcx} "; c=`expr $c + 1`; done + average_disp=$(SHOW_TIME ${average} s) + c=0; spcT=''; spc1=`expr ${cw} - ${#average_disp}`; until [ $c = ${spc1} ]; do spct="${spct} "; c=`expr $c + 1`; done + 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 [ -f ${NM_TMPFOLDER}/.replcheck ] && last_replcheck=$(date -d @$(stat -c %Y ${NM_TMPFOLDER}/.replcheck) "+%Y-%m-%d %H:%M:%S") || last_replcheck="" [ -f ${NM_LOGFOLDER}/status-check.scantimes ] && last_scancheck=$(date -d @$(stat -c %Y ${NM_LOGFOLDER}/status-check.scantimes) "+%Y-%m-%d %H:%M:%S") || last_scancheck="" echo -en "\r\033[K" - echo -e "${idsCL[LightCyan]}Average for last '${scansfound_norm}' : ${idsCL[LightGreen]}(${average_norm}s)${spca}${idsCL[Green]}${average_norm_disp}${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Average for last '${scansfound}' : ${idsCL[LightGreen]}(${average}s)${spct}${idsCL[Green]}${average_disp}${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Normal runs '${scansfound_norm}' : ${idsCL[LightGreen]}(${average_norm}s)${spca}${idsCL[Green]}${average_norm_disp}${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}w/Replication '${scansfound_repl}' : ${idsCL[LightGreen]}(${average_repl}s)${spcr}${idsCL[Green]}${average_repl_disp}${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Extreme Runs '${scansfound_xtr}' : ${idsCL[LightGreen]}(${average_xtr}s)${spcx}${idsCL[Green]}${average_xtr_disp}${idsCL[Default]}\n" + 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"