Update temp.inc.sh

This commit is contained in:
2023-12-17 11:17:44 -06:00
parent 8d7ab52709
commit ca59fe5131

View File

@@ -615,14 +615,14 @@ SERVERROOM_TEMP_DIFFERENCE(){
last_tempdiff=$(tail -n 1 ${PW_TMPFOLDER}/.log.sr.difference)
last_tempdiff=${last_tempdiff#*~}
tempdiffs=$(tail -n ${LAST} ${PW_TMPFOLDER}/.log.sr.difference)
longest_tempdiff=0
largest_tempdiff=0
IFS=$'\n'
read -rd '' -a tempdiffs <<<"${tempdiffs}"
unset IFS
tempdiff_total=0; scansfound=0
for tempdiff in "${tempdiffs[@]}"; do
[[ "${tempdiff}" = *"~"* ]] && tempdiff=${tempdiff#*~}
[ $(bc -l <<< "${tempdiff} >= ${longest_tempdiff}") -eq 1 ] && longest_tempdiff=${tempdiff}
[ $(bc -l <<< "${tempdiff} >= ${largest_tempdiff}") -eq 1 ] && largest_tempdiff=${tempdiff}
tempdiff_total=$(bc <<< "scale=2; ${tempdiff_total}+${tempdiff}")
((scansfound++))
done
@@ -630,20 +630,20 @@ SERVERROOM_TEMP_DIFFERENCE(){
[ ${scansfound} -eq 0 ] && average=0 || average=$(ROUND_NUMBER $(bc <<< "scale=2; ${tempdiff_total}/${scansfound}") 0)
last_tempdiff_disp=$(SHOW_TIME ${last_tempdiff} s)
longest_tempdiff_disp=$(SHOW_TIME ${longest_tempdiff} s)
largest_tempdiff_disp=$(SHOW_TIME ${largest_tempdiff} s)
[ -f ${PW_TMPFOLDER}/.log.sr.difference ] && last_scancheck=$(date -d @$(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference) "+%Y-%m-%d %H:%M:%S") || last_scancheck=""
echo -en "\r\033[K"
echo -e "${idsCL[LightCyan]}Scan Type Scans Average Temp Difference${idsCL[Default]}"
DIVIDER . lightCyan 60
echo -e "${idsCL[Green]}Average for last `IDS_NUMBER_FORMAT ${scansfound}` ${idsCL[LightGreen]}${average}${idsCL[Default]}"
echo -e "${idsCL[Green]}Average for last `IDS_NUMBER_FORMAT ${scansfound}` ${idsCL[LightGreen]}${average}'F${idsCL[Default]}"
DIVIDER . lightCyan 60
echo
echo -e "${idsCL[LightCyan]}Largest Temp Difference : ${idsCL[LightGreen]}${longest_tempdiff}${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Largest Temp Difference : ${idsCL[LightGreen]}${largest_tempdiff}'F${idsCL[Default]}"
echo
echo -e "${idsCL[LightCyan]}Last Temp Difference : ${idsCL[LightGreen]}${last_tempdiff}${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Last Check : ${idsCL[LightGreen]}${last_scancheck}${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Last Temp Difference : ${idsCL[LightGreen]}${last_tempdiff}'F${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Last Check : ${idsCL[LightGreen]}${last_scancheck}${idsCL[Default]}"
if [ ${scansfound} -le 500 ]; then
echo -en "\n${idsCL[LightCyan]}List out these '${scansfound}' scan times? (y/N): ${idsCL[Default]}"