Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
50 lines
1.4 KiB
Bash
Executable File
50 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Shared SSH Helper Module
|
|
# Provides common SSH utility functions
|
|
# Usage: source "$(dirname "${BASH_SOURCE[0]}")/../lib/ssh-helpers.sh"
|
|
|
|
# Source dependencies
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/ip-config.sh" 2>/dev/null || true
|
|
source "$SCRIPT_DIR/logging.sh" 2>/dev/null || true
|
|
|
|
# SSH helper functions
|
|
ssh_proxmox() {
|
|
local host="${1:-${PROXMOX_HOST_ML110:-192.168.11.10}}"
|
|
local command="${2:-}"
|
|
|
|
if [ -z "$command" ]; then
|
|
log_error "SSH command required"
|
|
return 1
|
|
fi
|
|
|
|
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@"$host" "$command"
|
|
}
|
|
|
|
ssh_container() {
|
|
local host="${1:-${PROXMOX_HOST_ML110:-192.168.11.10}}"
|
|
local vmid="${2:-}"
|
|
local command="${3:-}"
|
|
|
|
if [ -z "$vmid" ] || [ -z "$command" ]; then
|
|
log_error "VMID and command required"
|
|
return 1
|
|
fi
|
|
|
|
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@"$host" \
|
|
"pct exec $vmid -- $command"
|
|
}
|
|
|
|
# Test SSH connectivity
|
|
test_ssh_connection() {
|
|
local host="${1:-${PROXMOX_HOST_ML110:-192.168.11.10}}"
|
|
|
|
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@"$host" "echo 'SSH OK'" >/dev/null 2>&1; then
|
|
log_success "SSH connection to $host: OK"
|
|
return 0
|
|
else
|
|
log_error "SSH connection to $host: FAILED"
|
|
return 1
|
|
fi
|
|
}
|