#!/usr/bin/env bash # P4-P6 of agents/sage/work/window-plan/repin-rows-177-185.md (2ea05700b), read only. # P4 the tunnel unit, P5 the four REPO scripts against NEW, P6 the 7332 matrix on OLD (matrix-old.txt). # usage: p456.sh p4|p5|p6 set -uo pipefail REPO=/mnt/storage/src/mosaic-stack WIN=$REPO/agents/darkwing/work/window-rows-177-185 NEW=490e2771d3d057ab76991e2c7859cd251857e64c FILES=(scripts/stack-release.sh scripts/webui-service.sh scripts/bus-service.sh scripts/stack-copy.sh) # The plan's <32 letters>: a fixed dummy, not a secret. matrix-new.txt uses the same value. PROOF=abcdefghijklmnopqrstuvwxyzabcdef p4() { echo "# P4 $(date -u +%FT%TZ)" local out; out="$(systemctl --user show mosaic-preview-tunnel.service -p ExecStart -p DropInPaths)"; local rc=$? printf '%s\n' "$out"; echo "# exit $rc" local specs; specs="$(grep -oE 'R:[^ ;]+' <<<"$out")" local n; n="$(grep -c . <<<"$specs")" echo "# R: specs ($n): $(tr '\n' ' ' <<<"$specs")" local drop; drop="$(sed -n 's/^DropInPaths=//p' <<<"$out")" if [[ $rc -eq 0 && $n -eq 1 && "$specs" == "R:0.0.0.0:7332:127.0.0.1:7332" && -z "$drop" ]]; then echo "P4 PASS: one R: spec R:0.0.0.0:7332:127.0.0.1:7332, DropInPaths empty" else echo "P4 FAIL"; return 3 fi } p5() { echo "# P5 $(date -u +%FT%TZ); HEAD $(git -C $REPO rev-parse HEAD)" git -C $REPO diff --quiet $NEW HEAD -- "${FILES[@]}"; local d=$? echo "# git diff --quiet $NEW HEAD -- ${FILES[*]}: exit $d" local st; st="$(git -C $REPO status --porcelain -- "${FILES[@]}")"; local s=$? echo "# git status --porcelain (exit $s): [${st}]" for f in "${FILES[@]}"; do echo "# $f HEAD blob $(git -C $REPO rev-parse HEAD:$f) NEW blob $(git -C $REPO rev-parse $NEW:$f)"; done if [[ $d -eq 0 && $s -eq 0 && -z "$st" ]]; then echo "P5 PASS"; else echo "P5 FAIL"; return 3; fi } # one matrix line: label, then curl arguments; prints "