Update powerwall.sh
This commit is contained in:
18
powerwall.sh
18
powerwall.sh
@@ -66,12 +66,20 @@ CHECKTEMPSENSOR(){
|
|||||||
c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ $c = ${spc1} ]; do spct="${spct} "; c=`expr $c + 1`; done
|
c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ $c = ${spc1} ]; do spct="${spct} "; c=`expr $c + 1`; done
|
||||||
c=0; spca=''; spc1=`expr 6 - ${#average}`; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done
|
c=0; spca=''; spc1=`expr 6 - ${#average}`; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done
|
||||||
|
|
||||||
if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then
|
if [ $(bc -l <<< "$average >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$average < $temp_crit") -eq 1 ]; then
|
||||||
echo -en "${idsCL[Yellow]}WARNING (${spct}${temp_f}'F / ${spca}${average}'F)${idsCL[Default]}"
|
averagedisp="${idsCL[Yellow]}${average}'F"
|
||||||
elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then
|
elif [ $(bc -l <<< "$average >= $temp_crit") -eq 1 ]; then
|
||||||
echo -en "${idsCL[Red]}CRITICAL (${spct}${temp_f}'F / ${spca}${average}'F)${idsCL[Default]}"
|
averagedisp="${idsCL[Red]}${average}'F"
|
||||||
else
|
else
|
||||||
echo -en "${idsCL[Green]}Normal (${spct}${temp_f}'F / ${spca}${average}'F)${idsCL[Default]}"
|
averagedisp="${idsCL[Green]}${average}'F"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then
|
||||||
|
echo -en "${idsCL[Yellow]}WARNING (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Yellow])${idsCL[Default]}"
|
||||||
|
elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then
|
||||||
|
echo -en "${idsCL[Red]}CRITICAL (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Red]})${idsCL[Default]}"
|
||||||
|
else
|
||||||
|
echo -en "${idsCL[Green]}Normal (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Green]})${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
tmp="${spct}${temp_f}"
|
tmp="${spct}${temp_f}"
|
||||||
c=0; spc=''; spc1=`expr 10 - ${#tmp} - 2`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
c=0; spc=''; spc1=`expr 10 - ${#tmp} - 2`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||||
|
|||||||
Reference in New Issue
Block a user