Files
felhom.eu/documentation/audits/release-2b-3-2026-11-15/part2/wait-hublog.sh
T

11 lines
482 B
Bash

#!/bin/bash
# wait-hublog.sh 'REGEX' SINCE(e.g. 5m) [MINUTES] — wait for a hub log line (a read each 20 s), print the matches.
R=$1; SINCE=$2; M=${3:-20}
end=$(( $(date +%s) + M*60 ))
while [ "$(date +%s)" -lt "$end" ]; do
out=$(sudo kubectl -n felhom-system logs deploy/hub --since="$SINCE" 2>/dev/null | grep -iE "$R")
if [ -n "$out" ]; then echo "$(date +%T) found:"; echo "$out" | cut -c1-320; exit 0; fi
sleep 20
done
echo "$(date +%T) TIMEOUT: no line for $R"; exit 1