From 7d19ec110e6ffa85d8f0a5ae8fdd3667f56ff385 Mon Sep 17 00:00:00 2001 From: aitbc Date: Mon, 20 Apr 2026 20:28:35 +0200 Subject: [PATCH] fix: use IP address for local node detection in ssh_exec - Compare node IP against local IP instead of hostname - Fixes SSH permission issues when running on gitea-runner - gitea-runner (10.1.223.98) should execute commands directly for aitbc2 --- scripts/multi-node/blockchain-health-check.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/multi-node/blockchain-health-check.sh b/scripts/multi-node/blockchain-health-check.sh index bed0610f..a4764ec8 100755 --- a/scripts/multi-node/blockchain-health-check.sh +++ b/scripts/multi-node/blockchain-health-check.sh @@ -58,8 +58,11 @@ ssh_exec() { local node="$1" local command="$2" - # If node is localhost, execute directly without SSH - if [ "$node" = "localhost" ] || [ "$node" = "$(hostname)" ]; then + # Get local IP address + local local_ip=$(hostname -I | awk '{print $1}') + + # If node is localhost or local IP, execute directly without SSH + if [ "$node" = "localhost" ] || [ "$node" = "$(hostname)" ] || [ "$node" = "$local_ip" ]; then bash -c "$command" 2>&1 || return 1 else ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$node" "$command" 2>&1 || return 1