fix: use IP address for local node detection in ssh_exec
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
Multi-Node Blockchain Health Monitoring / health-check (push) Has been cancelled
P2P Network Verification / p2p-verification (push) Has been cancelled

- 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
This commit is contained in:
aitbc
2026-04-20 20:28:35 +02:00
parent 717fd4cb7c
commit 7d19ec110e

View File

@@ -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