Update powerwall.sh
This commit is contained in:
@@ -245,8 +245,6 @@ CHECKTEMP_SERVICE(){
|
|||||||
fi
|
fi
|
||||||
if [ "${SENSORS_CHECK}" != "" ]; then
|
if [ "${SENSORS_CHECK}" != "" ]; then
|
||||||
for SENSOR in "${SENSORS_CHECK[@]}"; do
|
for SENSOR in "${SENSORS_CHECK[@]}"; do
|
||||||
[ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0
|
|
||||||
echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}"
|
|
||||||
if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then
|
if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then
|
||||||
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn
|
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn
|
||||||
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit
|
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit
|
||||||
@@ -292,7 +290,8 @@ CHECKTEMP_SERVICE(){
|
|||||||
temp_h=''
|
temp_h=''
|
||||||
|
|
||||||
fi
|
fi
|
||||||
echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}"
|
[ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0
|
||||||
|
|
||||||
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
|
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
|
||||||
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
|
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
|
||||||
[ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGE="CPU-USAGE" || GAUGE="TEMP"
|
[ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGE="CPU-USAGE" || GAUGE="TEMP"
|
||||||
@@ -303,7 +302,6 @@ CHECKTEMP_SERVICE(){
|
|||||||
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.reading
|
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.reading
|
||||||
|
|
||||||
fi
|
fi
|
||||||
echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}"
|
|
||||||
|
|
||||||
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(echo "scale=2; ${temp_c}*1.8 + 32" | bc)
|
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(echo "scale=2; ${temp_c}*1.8 + 32" | bc)
|
||||||
[ "${SENSOR}" == "ServerRoomTH" ] && temp_f=`echo "scale=2; ${temp_f}+${PW_ServerRoomTH_Dev}" | bc`
|
[ "${SENSOR}" == "ServerRoomTH" ] && temp_f=`echo "scale=2; ${temp_f}+${PW_ServerRoomTH_Dev}" | bc`
|
||||||
@@ -316,9 +314,7 @@ CHECKTEMP_SERVICE(){
|
|||||||
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
|
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 1
|
|
||||||
if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then
|
if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then
|
||||||
echo "2 - ${last_temp[${SENSOR//-/}]}"
|
|
||||||
if (( $(bc <<< "${last_temp[${SENSOR//-/}]} > 1") )); then
|
if (( $(bc <<< "${last_temp[${SENSOR//-/}]} > 1") )); then
|
||||||
SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH}
|
SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH}
|
||||||
Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
|
Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
|
||||||
@@ -327,7 +323,6 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
|
|||||||
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
|
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
|
||||||
|
|
||||||
elif [ "${last_temp[${SENSOR//-/}]}" == "0" ]; then
|
elif [ "${last_temp[${SENSOR//-/}]}" == "0" ]; then
|
||||||
echo 4
|
|
||||||
# SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup
|
# SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup
|
||||||
# NORMAL TEMP: ${temp_f}${GAUGESH}"
|
# NORMAL TEMP: ${temp_f}${GAUGESH}"
|
||||||
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp}
|
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp}
|
||||||
|
|||||||
Reference in New Issue
Block a user