Update powerwall.sh
This commit is contained in:
@@ -380,7 +380,7 @@ Previous Temp: ${last_temp[${SENSOR}]}'F"
|
||||
if [ ${lastinsert} -ge ${wait} ]; then
|
||||
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
||||
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${vSENSOR// /_}' AND sensorid='${PW_SENSOR_ID[${SENSORa}]}'"))
|
||||
if [ "${entity[1]}" == "" ]; then
|
||||
if [ "${entityid[1]}" == "" ]; then
|
||||
${mysql_conn} -e "USE servermonitor; INSERT INTO entities (\`sensorid\`, \`name\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','${vSENSOR// /_}')"
|
||||
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${vSENSOR// /_}' AND sensorid='${PW_SENSOR_ID[${SENSORa}]}'"))
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user