1
0
forked from finn/tinyboard

fix keyscan validation to die early if spoke tunnel is not up

This commit is contained in:
Justin Oros
2026-04-16 09:18:40 -07:00
parent 114c97a1cb
commit 7bdafd316c

View File

@@ -31,7 +31,9 @@ mkdir -p "$(dirname "$RCLONE_CONF")"
header "Checking Tunnel"
info "Scanning spoke host key..."
ssh-keyscan -p "$TUNNEL_PORT" -H localhost >> "$SSH_DIR/known_hosts" 2>/dev/null
KEYSCAN=$(ssh-keyscan -p "$TUNNEL_PORT" -H localhost 2>/dev/null)
[ -n "$KEYSCAN" ] || die "Spoke not reachable on port $TUNNEL_PORT — is the tunnel up?"
echo "$KEYSCAN" >> "$SSH_DIR/known_hosts"
info "Verifying spoke is reachable on port $TUNNEL_PORT..."
if ssh -o BatchMode=yes -o ConnectTimeout=10 -p "$TUNNEL_PORT" armbian@localhost exit 2>/dev/null; then