gates / gates (push) Successful in 2m9s
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
11 lines
641 B
Bash
11 lines
641 B
Bash
#!/bin/bash
|
|
# wait-moved.sh SSH_TARGET [MINUTES] — wait until the box's agent config holds a ca_file (a read each 30 s).
|
|
T=$1; M=${2:-25}
|
|
end=$(( $(date +%s) + M*60 ))
|
|
while [ "$(date +%s)" -lt "$end" ]; do
|
|
cur=$(timeout 15 ssh -o BatchMode=yes -o ConnectTimeout=8 "$T" "python3 -c 'import json;t=json.load(open(\"/etc/felhom-agent/agent.json\")).get(\"proxmox\",{}).get(\"tls\",{});print(\"ca=\"+t.get(\"ca_file\",\"\")+\" fp=\"+(\"set\" if t.get(\"fingerprint\") else \"empty\"))'" 2>/dev/null)
|
|
case "$cur" in ca=/*) echo "$(date +%T) $T $cur"; exit 0;; esac
|
|
sleep 30
|
|
done
|
|
echo "$(date +%T) $T TIMEOUT: ${cur:-unreadable}"; exit 1
|