Update powerwall.sh
This commit is contained in:
10
powerwall.sh
10
powerwall.sh
@@ -20,12 +20,12 @@ CHECKTEMP(){
|
|||||||
if [ "${1}" != "" ]; then
|
if [ "${1}" != "" ]; then
|
||||||
reading=$(CHECKTEMPSENSOR ${1})
|
reading=$(CHECKTEMPSENSOR ${1})
|
||||||
c=0; spc=''; spc1=`expr ${cw} - ${#1}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
c=0; spc=''; spc1=`expr ${cw} - ${#1}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||||
echo "${1}${spc}: ${reading}"
|
echo -e "${idsCL[LightCyan]}${1}${spc}${idsCL[Default]}: ${reading}"
|
||||||
else
|
else
|
||||||
for SENSOR in ${!SENSOR_ID[@]}; do
|
for SENSOR in ${!SENSOR_ID[@]}; do
|
||||||
reading=$(CHECKTEMPSENSOR ${SENSOR})
|
reading=$(CHECKTEMPSENSOR ${SENSOR})
|
||||||
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||||
echo "${SENSOR}${spc}: ${reading}"
|
echo -e "${idsCL[LightCyan]}${SENSOR}${spc}${idsCL[Default]}: ${reading}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
@@ -42,11 +42,11 @@ CHECKTEMPSENSOR(){
|
|||||||
echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit
|
echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit
|
||||||
|
|
||||||
if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then
|
if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then
|
||||||
echo "WARNING: $temp_f°F"
|
echo -e "${idsCL[LightMagenta]}WARNING: $temp_f°F${idsCL[Default]}"
|
||||||
elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then
|
elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then
|
||||||
echo "CRITICAL: $temp_f°F"
|
echo -e "${idsCL[Red]}CRITICAL: $temp_f°F${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo "normal: $temp_f°F"
|
echo -e "${idsCL[Green]}normal: $temp_f°F${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user