mirror of
https://github.com/Koenkk/zigbee-OTA.git
synced 2026-09-26 14:31:27 +00:00
Add sha512 checksum to OTA firmwares (#25)
* Add sha512 checksum to OTA firmwares This hashes firmware during download and adds the hash to index.json. Additionally, this PR adds `updateall.js` script which reads all entries and runs `add.js` on each of them (for mass updates, such as the hash algorithm or URL encoding etc). To allow for this to happen, this PR adds the ability to modify entries in-place via `add.js` (if called on an existing path in the repo). Lastly, this normalises the path for the Gledopto firmware to lowercase its file extensions; they were previously `.OTA` in index.json but `.ota` in the repository & in the `url` field -- something picked up by the mass update. * Update README.md Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
co-authored by
Koen Kanters
parent
8e17765e3f
commit
a45b49f4d0
@@ -0,0 +1,15 @@
|
||||
const child_process = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const main = async () => {
|
||||
const indexJSON = JSON.parse(fs.readFileSync('index.json'));
|
||||
indexJSON.forEach(entry => {
|
||||
const result = child_process.execSync(`node ./scripts/add.js "${entry.path || entry.url}" "${entry.modelId || ''}"`, {
|
||||
cwd: path.dirname(__dirname)
|
||||
})
|
||||
console.log(result.toString())
|
||||
})
|
||||
}
|
||||
|
||||
return main();
|
||||
Reference in New Issue
Block a user