diff --git a/inc/status.inc b/inc/status.inc index e2ffb71a..60550758 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -773,11 +773,12 @@ STATUS_SCANTIMES(){ echo -en "${idsCL[Yellow]}Pulling data and calculating average scan times for the last '${LAST}' scans ... " scantimes=($(tail -n ${LAST} ${NM_LOGFOLDER}/status-check.scantimes)) - scantimes_total=0 + scantimes_total=0; scansfound=0 for scantime in "${scantimes[@]}"; do scantimes_total=$(bc <<< "scale=1; ${scantimes_total}+${scantime}") + ((scansfound++)) done - average=$(bc <<< "scale=1; ${scantimes_total}/${LAST}") + average=$(bc <<< "scale=1; ${scantimes_total}/${scansfound}") echo -en "\r\033[K" echo -e "${idsCL[LightCyan]}Average scan time for the last '${LAST}' scans : ${idsCL[Green]}${average}${idsCL[Default]}\n"