Created
December 21, 2020 08:09
-
-
Save sveba/d0b60b54b14b317be2a9042ede65697b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
DEVICE_IP=$1 | |
TASMOTA_URL=http://dice:40000/web/tasmota-lite.bin | |
DEVICE_ID=`curl -X POST http://$DEVICE_IP:8081/zeroconf/info -d '{"data": {}}' -H "Content-Type: application/json" | jq -r .data.deviceid` | |
wget $TASMOTA_URL | |
curl http://$DEVICE_IP:8081/zeroconf/ota_unlock -XPOST -d "{\"deviceid\":\"$DEVICE_ID\",\"data\":{}}" | |
curl http://$DEVICE_IP:8081/zeroconf/info -XPOST -d "{\"deviceid\":\"$DEVICE_ID\",\"data\":{}}" | |
SHA256=$(sha256sum tasmota-lite.bin | cut -f1 -d\ ) | |
curl http://$DEVICE_IP:8081/zeroconf/ota_flash -X POST -d "{\"deviceid\": \"$DEVICE_ID\" , \"data\": {\"downloadUrl\": \"$TASMOTA_URL\" , \"sha256sum\": \"$SHA256\" } }" -vvv | |
rm tasmota-lite.bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment