improved script reliability

This commit is contained in:
Your Name 2021-07-01 20:40:51 +02:00
parent 7c9a0bf6f1
commit d2010ddebb

View File

@ -16,6 +16,7 @@ mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
echo "Waiting ..."
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
set -e
sleep 30
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/set" -m "{
\"settings\": {
\"sleep\":600,
@ -64,11 +65,12 @@ mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/s
\"lowLight6\": false,
\"delay6\": 10
}
}" -r
}"
echo "Waiting for reboot"
sleep 1
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
sleep 20
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/config/backup/set" -m "true" -r
sleep 5
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r
exit 0