infra: the box set-up's ingest probe tolerates the usage exit

fly-shadow ingest without --root exits 2; piped into grep under pipefail the
probe failed even when the message matched, so the set-up refused every
release. Found on its first run as root on a real box.
This commit is contained in:
acamilo 2026-10-01 05:56:11 +00:00
parent 519503a523
commit 16cb3b754b

View file

@ -76,7 +76,9 @@ else
fi fi
(cd "$release" && sha256sum -c MANIFEST --quiet) || die "MANIFEST verification failed for $release" (cd "$release" && sha256sum -c MANIFEST --quiet) || die "MANIFEST verification failed for $release"
[ -x "$release/fly-shadow" ] || die "$release has no fly-shadow: this release predates SHADOW-01" [ -x "$release/fly-shadow" ] || die "$release has no fly-shadow: this release predates SHADOW-01"
"$release/fly-shadow" ingest 2>&1 | grep -q 'needs --root' \ # The bare subcommand exits 2 (usage); under pipefail a pipe into grep would fail on that, so capture.
probe="$("$release/fly-shadow" ingest 2>&1 || true)"
printf '%s' "$probe" | grep -q 'needs --root' \
|| die "$release/fly-shadow has no ingest: this release predates SHADOW-02" || die "$release/fly-shadow has no ingest: this release predates SHADOW-02"
ln -sfn "$release" /opt/fly/current.tmp && mv -T /opt/fly/current.tmp /opt/fly/current ln -sfn "$release" /opt/fly/current.tmp && mv -T /opt/fly/current.tmp /opt/fly/current
log "/opt/fly/current -> $release" log "/opt/fly/current -> $release"