Files
proxmox/scripts/archive/consolidated/config/configure-container-networks.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- 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>
2026-02-12 15:46:57 -08:00

63 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
# Configure network interfaces for all reassigned containers
set -uo pipefail
NODE_IP="${PROXMOX_HOST_R630_01}"
# Container IP mappings
declare -A container_ips=(
["10000"]="${ORDER_POSTGRES_PRIMARY:-192.168.11.44}"
["10001"]="${ORDER_POSTGRES_REPLICA:-192.168.11.45}"
["10020"]="${ORDER_REDIS_IP:-192.168.11.38}"
["10030"]="192.168.11.40"
["10040"]="192.168.11.41"
["10050"]="192.168.11.49"
["10060"]="192.168.11.42"
["10070"]="${IP_SERVICE_50:-${IP_SERVICE_50:-${IP_SERVICE_50:-${IP_SERVICE_50:-192.168.11.50}}}}"
["10080"]="192.168.11.43"
["10090"]="${IP_SERVICE_36:-${IP_SERVICE_36:-${IP_SERVICE_36:-${IP_SERVICE_36:-192.168.11.36}}}}"
["10091"]="${IP_SERVICE_35:-${IP_SERVICE_35:-${IP_SERVICE_35:-${IP_SERVICE_35:-192.168.11.35}}}}"
["10092"]="${IP_MIM_WEB:-192.168.11.37}"
["10200"]="192.168.11.46"
["10201"]="192.168.11.47"
["10202"]="192.168.11.48"
["10210"]="192.168.11.39"
["10230"]="${IP_SERVICE_51:-${IP_SERVICE_51:-${IP_SERVICE_51:-${IP_SERVICE_51:-192.168.11.51}}}}"
["10232"]="192.168.11.52"
)
GATEWAY="${NETWORK_GATEWAY:-192.168.11.1}"
echo "═══════════════════════════════════════════════════════════"
echo "Configuring Network Interfaces for Reassigned Containers"
echo "═══════════════════════════════════════════════════════════"
echo ""
SUCCESS=0
FAILED=0
for vmid in "${!container_ips[@]}"; do
ip="${container_ips[$vmid]}"
echo "Configuring CT $vmid ($ip)..."
# Bring up interface and configure IP
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${NODE_IP} \
"pct exec $vmid -- sh -c 'ip link set eth0 up && ip addr add $ip/24 dev eth0 2>/dev/null; ip route add default via $GATEWAY dev eth0 2>/dev/null'" 2>&1; then
echo " ✅ Network configured"
((SUCCESS++))
else
echo " ❌ Failed to configure network"
((FAILED++))
fi
done
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "Configuration Complete"
echo "═══════════════════════════════════════════════════════════"
echo " Success: $SUCCESS"
echo " Failed: $FAILED"
echo " Total: ${#container_ips[@]}"
echo "═══════════════════════════════════════════════════════════"