OTA Update Pipeline

Hard Shell Build
Solve this problem

Create a shell-based Over-The-Air (OTA) firmware update pipeline for embedded devices. The pipeline should download a firmware image from a remote server, verify checksum, stage it in a temporary directory, and trigger the flashing tool. Logging and rollback must be included.

Constraints

  • Accept URL as input.
  • Use curl or wget to download.
  • Compute SHA256 checksum.
  • Compare checksum with .sha256 file.
  • On success: call flash.sh <image>.
  • On failure: rollback and log error.
  • Exit code 0 on success, non-zero on failure.
Starter codeShell
1#!/bin/bash2# TODO