Update powerwall.sh
This commit is contained in:
16
powerwall.sh
16
powerwall.sh
@@ -192,9 +192,9 @@ CHECKTEMP_SERVICE(){
|
||||
|
||||
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
||||
temp_c=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /}
|
||||
temp_warn=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); #temp_warn=${temp_warn/ /}
|
||||
temp_crit=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); #temp_crit=${temp_crit/ /}
|
||||
temp_crit_sys=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); #temp_crit_sys=${temp_crit_sys/ /}
|
||||
temp_warn=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g');
|
||||
temp_crit=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g');
|
||||
temp_crit_sys=$(echo ${SENSOR} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g');
|
||||
|
||||
temp_warn=`echo $(bc <<< "scale=2; (${temp_warn/ /}*1.8+32)/1") | awk '{print int($1+0.5)}'`
|
||||
temp_crit=`echo $(bc <<< "scale=2; (${temp_crit/ /}*1.8+32)/1") | awk '{print int($1+0.5)}'`
|
||||
@@ -203,9 +203,7 @@ CHECKTEMP_SERVICE(){
|
||||
temp_h=''
|
||||
vSENSOR=$(echo ${SENSOR} | cut -d'T' -f1 | xargs)
|
||||
SENSOR="${SENSORa}-${vSENSOR// /_}"
|
||||
|
||||
echo "HERE: ${SENSOR} - ${temp_c} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}"
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -214,12 +212,14 @@ CHECKTEMP_SERVICE(){
|
||||
if [ "$temp_c" != "null" ] && [ "$temp_c" != "" ]; then
|
||||
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then
|
||||
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
|
||||
echo "($datetime) - ${SENSOR} - ${SENSOR} is reporting data again" >> ${logtemp}
|
||||
echo "($datetime) - ${SENSOR} - Sensor is reporting data again" >> ${logtemp}
|
||||
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.reading
|
||||
|
||||
fi
|
||||
temp_f=`echo "scale=2; $temp_c*1.8 + 32" | bc`
|
||||
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" != "esxi" ]; then
|
||||
echo "HERE: ${SENSOR} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}"
|
||||
|
||||
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then
|
||||
echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn
|
||||
echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit
|
||||
echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
|
||||
|
||||
Reference in New Issue
Block a user