Update powerwall.sh
This commit is contained in:
@@ -146,7 +146,7 @@ AVERAGETEMP(){
|
||||
CHECKTEMP_SERVICE(){
|
||||
cw=20
|
||||
declare -A last_temp
|
||||
# while true; do
|
||||
while true; do
|
||||
|
||||
for SENSORa in ${!PW_SENSOR_ID[@]}; do
|
||||
logtemp=${PW_LOGFOLDER}/log-temp-${SENSORa}
|
||||
@@ -275,7 +275,7 @@ CHECKTEMP_SERVICE(){
|
||||
[ "$(compgen -G "${PW_FOLDER}/shutdown.*")" != "" ] && rm -f ${PW_FOLDER}/shutdown.*
|
||||
|
||||
elif [ ${last_temp[${SENSOR}]} -eq 0 ]; then
|
||||
# SENDNOTICE "${SENSOR} TEMP NORMAL" "($datetime) Service Startup
|
||||
SENDNOTICE "${SENSOR} TEMP NORMAL" "($datetime) Service Startup
|
||||
# NORMAL TEMP: ${temp_f}'F"
|
||||
echo -e "($datetime) - ${temp_f}'F - Service Startup - NORMAL TEMP" >> ${logtemp}
|
||||
echo -e "($datetime) - ${temp_f}'F - ${SENSOR} - Service Startup" >> ${PW_LOGFILE}
|
||||
@@ -301,8 +301,8 @@ CHECKTEMP_SERVICE(){
|
||||
else
|
||||
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSOR}]}','${datetime}','${temp_f}')"
|
||||
fi
|
||||
# ${mysql_conn} -e "${QRY}"
|
||||
# touch ${PW_TMPFOLDER}/${SENSOR}.insert
|
||||
${mysql_conn} -e "${QRY}"
|
||||
touch ${PW_TMPFOLDER}/${SENSOR}.insert
|
||||
fi
|
||||
else
|
||||
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 1800 ]; then
|
||||
|
||||
Reference in New Issue
Block a user