Environment Sanity Guard
Guard a deployment script by validating every required environment variable up front, checking not just presence but basic format.
Constraints
- Required: DEVICE_ID, FIRMWARE_PATH, SERVER_URL.
- DEVICE_ID must be exactly 12 hex characters.
- FIRMWARE_PATH must exist and be readable.
- SERVER_URL must start with https://.
- Report every failure, not just the first.
- Exit 1 on any failure.
1#!/bin/sh2# TODO: validate the environment