ZZZ Digital Lab

Back to WaitLens

target/capture.sh

#!/bin/sh
# Run ONLY on an owner-licensed QNX 8.0 target, from a fresh capture directory.
# This is a QNX target shell script, not Git-for-Windows/MSYS.
set -eu
for file in platform.txt probe.log send.txt reply.txt capture-complete.txt; do
    if [ -e "$file" ]; then
        echo "Refusing to overwrite $file; use a fresh capture directory." >&2
        exit 2
    fi
done
uname -s > platform.txt
uname -r >> platform.txt
./waitlens_probe > probe.log 2>&1 &
probe_pid=$!
trap 'kill "$probe_pid" 2>/dev/null || true' 0
trap 'exit 2' 1 2 15
sleep 2
pidin -p waitlens_probe -F "%a %b %60n %p %J %B" > send.txt
sleep 6
pidin -p waitlens_probe -F "%a %b %60n %p %J %B" > reply.txt
wait "$probe_pid"
trap - 0 1 2 15
printf '%s\n' "${1:-complete}" > capture-complete.txt
echo "Capture complete. Verify SEND and REPLY rows before using as evidence."