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>
100 lines
3.1 KiB
Bash
Executable File
100 lines
3.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Verify IP address consistency across documentation and configuration files
|
|
# Compares IPs in key files against the physical hardware inventory
|
|
|
|
set -euo pipefail
|
|
|
|
# Load IP configuration
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
log_warn() { echo -e "${YELLOW}[⚠]${NC} $1"; }
|
|
log_error() { echo -e "${RED}[✗]${NC} $1"; }
|
|
|
|
# Load inventory
|
|
source "$SCRIPT_DIR/load-physical-inventory.sh" 2>/dev/null || {
|
|
log_error "Failed to load physical hardware inventory"
|
|
exit 1
|
|
}
|
|
|
|
log_info "=== IP Address Consistency Verification ==="
|
|
echo ""
|
|
|
|
# Expected IPs from inventory
|
|
declare -A EXPECTED_IPS=(
|
|
["ml110"]="${PROXMOX_HOST_ML110}"
|
|
["r630-01"]="${PROXMOX_HOST_R630_01}"
|
|
["r630-02"]="${PROXMOX_HOST_R630_02}"
|
|
["r630-03"]="${IP_SERVICE_13:-${IP_SERVICE_13:-${IP_SERVICE_13:-${IP_SERVICE_13:-192.168.11.13}}}}"
|
|
["r630-04"]="${IP_DEVICE_14:-${IP_DEVICE_14:-${IP_DEVICE_14:-${IP_DEVICE_14:-192.168.11.14}}}}"
|
|
["omada"]="192.168.11.8"
|
|
["er605-1"]="76.53.10.34"
|
|
["er605-2"]="76.53.10.41"
|
|
)
|
|
|
|
# Files to check
|
|
FILES_TO_CHECK=(
|
|
"config/physical-hardware-inventory.conf"
|
|
"config/physical-hardware-inventory.md"
|
|
"docs/02-architecture/PHYSICAL_HARDWARE_INVENTORY.md"
|
|
"docs/04-configuration/OMADA_API_SETUP.md"
|
|
"mcp-omada/README.md"
|
|
"mcp-omada/src/index.ts"
|
|
)
|
|
|
|
ERRORS=0
|
|
WARNINGS=0
|
|
|
|
# Check each file
|
|
for file in "${FILES_TO_CHECK[@]}"; do
|
|
filepath="$PROJECT_ROOT/$file"
|
|
if [[ ! -f "$filepath" ]]; then
|
|
log_warn "File not found: $file"
|
|
((WARNINGS++))
|
|
continue
|
|
fi
|
|
|
|
log_info "Checking: $file"
|
|
|
|
# Check for incorrect Omada IP (${PROXMOX_HOST_ML110:-192.168.11.10} instead of 192.168.11.8)
|
|
if grep -q "${PROXMOX_HOST_ML110:-192.168.11.10}.*8043\|${PROXMOX_HOST_ML110:-192.168.11.10}:8043" "$filepath" 2>/dev/null; then
|
|
log_error " Found incorrect Omada IP (${PROXMOX_HOST_ML110:-192.168.11.10}:8043) - should be 192.168.11.8:8043"
|
|
((ERRORS++))
|
|
fi
|
|
|
|
# Check for incorrect ER605-1 IP (76.53.10.35 instead of 76.53.10.34)
|
|
if grep -q "76.53.10.35" "$filepath" 2>/dev/null && ! grep -q "76.53.10.34" "$filepath" 2>/dev/null; then
|
|
log_error " Found incorrect ER605-1 IP (76.53.10.35) - should be 76.53.10.34"
|
|
((ERRORS++))
|
|
fi
|
|
|
|
# Check for incorrect ER605-2 IP (76.53.10.36 instead of 76.53.10.41)
|
|
if grep -q "76.53.10.36" "$filepath" 2>/dev/null && ! grep -q "76.53.10.41" "$filepath" 2>/dev/null; then
|
|
log_error " Found incorrect ER605-2 IP (76.53.10.36) - should be 76.53.10.41"
|
|
((ERRORS++))
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
if [[ $ERRORS -eq 0 ]]; then
|
|
log_success "✓ All IP addresses are consistent"
|
|
exit 0
|
|
else
|
|
log_error "✗ Found $ERRORS IP inconsistency issue(s)"
|
|
exit 1
|
|
fi
|