gates / gates (push) Successful in 2m9s
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
11 lines
562 B
Bash
11 lines
562 B
Bash
#!/bin/bash
|
|
# wait-bundle.sh SSH_TARGET VERSION [MINUTES] — wait until the box's journal says the config bundle VERSION is installed.
|
|
T=$1; V=$2; M=${3:-22}
|
|
end=$(( $(date +%s) + M*60 ))
|
|
while [ "$(date +%s)" -lt "$end" ]; do
|
|
n=$(timeout 20 ssh -o BatchMode=yes -o ConnectTimeout=8 "$T" "journalctl -u felhom-agent --since '-60min' --no-pager | grep 'config bundle INSTALLED' | grep -c 'agent_version=$V'" 2>/dev/null)
|
|
if [ "${n:-0}" -ge 1 ]; then echo "$(date +%T) $T bundle $V installed"; exit 0; fi
|
|
sleep 30
|
|
done
|
|
echo "$(date +%T) $T TIMEOUT"; exit 1
|