Skip to content

Fix unbound RATE_MB_HR under set -u; drop dead code in helper scripts#68

Merged
teknogeek0 merged 1 commit into
mainfrom
fix/script-cleanups
Jul 21, 2026
Merged

Fix unbound RATE_MB_HR under set -u; drop dead code in helper scripts#68
teknogeek0 merged 1 commit into
mainfrom
fix/script-cleanups

Conversation

@teknogeek0

Copy link
Copy Markdown
Contributor

Three small fixes surfaced while running the scripts and via shellcheck.

  • check-cdc-status.sh — real bug. RATE_MB_HR/RATE_GB_HR are only assigned inside the rate-calc block, which is skipped when no apply rate can be computed yet (e.g. <60s elapsed, no applied bytes). The later total-gap ETA branch reads RATE_MB_HR under set -u, so the script aborted with RATE_MB_HR: unbound variable. Initialize both to "" with the other rate vars.
  • preflight-check.sh — remove unused TOTAL (computed but never printed; the summary reports pass/warn/fail separately).
  • verify-migration.sh — remove never-called q_verbose().

Verification: bash -n passes on all three; shellcheck clean of the targeted findings (remaining items are known-benign — source-follow on ~/.env, ls in timestamped dirs, tilde in display strings).

- check-cdc-status.sh: initialize RATE_MB_HR/RATE_GB_HR alongside the other
  rate vars so the total-gap ETA branch does not abort with an unbound-variable
  error under set -u when no apply rate has been computed yet.
- preflight-check.sh: remove unused TOTAL.
- verify-migration.sh: remove never-called q_verbose().
@teknogeek0
teknogeek0 merged commit 6520339 into main Jul 21, 2026
@teknogeek0
teknogeek0 deleted the fix/script-cleanups branch July 21, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants