gates / gates (push) Successful in 2m9s
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
11 lines
482 B
Bash
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
|