mirror of
https://github.com/aljazceru/addons.git
synced 2026-02-21 12:54:25 +01:00
* Migrate deconz to ingress/discovery * update chmod * Add discovery * Fix lint * Fix typo * Bump versio 0.91.2 * Fix discovery * Cleanup config * Fix discovery * Fix url * Fix port * Fix script * Support new host config * Use new network feature * add notes * Fix shell * simplify v1 * Cleanup * Fix api port access * Remove waiting * Use more modern version * Fix lint * Add a note to ingress phoscon app * fix format * Fix ingress * Fix ingress * Fix output * Change flow * Fix wait port * Fix config * Add tiemout * Cleanup
33 lines
749 B
Bash
Executable File
33 lines
749 B
Bash
Executable File
#!/bin/bash
|
|
|
|
URL_IKEA="http://fw.ota.homesmart.ikea.net/feed/version_info.json"
|
|
|
|
while true
|
|
do
|
|
|
|
# fetch data
|
|
if ! IKEA_DATA="$(curl -sL ${URL_IKEA})"; then
|
|
echo "[Info] Can't fetch data from ikea!"
|
|
sleep 18000
|
|
continue
|
|
fi
|
|
|
|
IKEA_DATA_SIZE="$(echo "${IKEA_DATA}" | jq --raw-output '. | length')"
|
|
for (( i=0; i < "${IKEA_DATA_SIZE}"; i++ )); do
|
|
OTAU_URL=$(echo "${IKEA_DATA}" | jq --raw-output ".[$i].fw_binary_url // empty")
|
|
|
|
if [ -z "${OTAU_URL}" ]; then
|
|
continue
|
|
fi
|
|
|
|
OTAU_FILE="/data/otau/${OTAU_URL##*/}"
|
|
if [ -f "${OTAU_FILE}" ]; then
|
|
continue
|
|
fi
|
|
|
|
curl -s -L -o "${OTAU_FILE}" "${OTAU_URL}"
|
|
done
|
|
|
|
sleep 259200
|
|
done
|