π rc-verify.sh
Version: v0.2.2 Script Path:
bones/scripts/rc-verify.sh
Purpose
- Enforce file integrity by recomputing SHA256 checksums for each
file listed in
asset-manifest.yamland comparing them to recorded values. - Prevent unblessed or tampered files from persisting by failing on any mismatch.
CLI Interface
rc-verify.sh [--dry-run] [--verbose] [--help] [--warn-only] [--update] [--manifest-path PATH]Supported flags:
--help,-hShow usage information and exit.--dry-runPreview actions without writing changes.--verbose,-vShow detailed logs.--warn-onlyLog mismatches without non-zero exit.--updateUpdate manifest entries with computed checksums.--manifest-path PATHSpecify alternate manifest file.
Workflow Steps
Setup & Configuration
- Locate
asset-manifest.yamland ensurelogs/directory exists. - Parse CLI flags for custom behavior.
- Locate
Load Manifest
- Use
yqto read each assetpathandsha256value from the manifest.
- Use
Verification Loop For each manifest entry, recompute SHA256, compare, log
OKorERROR; on mismatches respect--warn-only.Skip any entries where the
pathis empty or malformed.Manifest Update (optional)
- If
--updateis used, replace expected SHA values in the manifest with computed ones.
- If
Completion & Exit
- If any mismatches occurred and not in
--warn-only, exit code1. - On success or
--warn-only, exit code0.
- If any mismatches occurred and not in
Exit Codes
0β All files verified (or mismatches only logged in--warn-onlymode).1β One or more mismatches detected.2β Manifest not found, or tracked file is missing.
Examples
# Standard verify
./bones/scripts/rc-verify.sh
# Preview without writing
./bones/scripts/rc-verify.sh --dry-run --verbose
# Warn-only mode
./bones/scripts/rc-verify.sh --warn-only
# Update manifest
./bones/scripts/rc-verify.sh --update
# Custom manifest
./bones/scripts/rc-verify.sh --manifest-path config/custom-manifest.yaml