diff options
| author | doc <doc@filenotfound.org> | 2025-09-16 11:30:38 +0000 |
|---|---|---|
| committer | doc <doc@filenotfound.org> | 2025-09-16 11:30:38 +0000 |
| commit | 5cfeb2cf156705349730bdc6ce883fd8eb22e728 (patch) | |
| tree | 13758f78513ed74198d2257c11c0ef9a913725d1 /reorder_validation.sh | |
Diffstat (limited to 'reorder_validation.sh')
| -rwxr-xr-x | reorder_validation.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/reorder_validation.sh b/reorder_validation.sh new file mode 100755 index 0000000..29de3f3 --- /dev/null +++ b/reorder_validation.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +echo "🔍 Starting IP validation and connectivity tests..." + +declare -A CONTAINERS +CONTAINERS=( + [archivecontrol]="10.196.1.10" + [archivelist]="10.196.1.20" + [ftp]="10.196.1.30" + [hostingtoot]="10.196.1.40" + [humptydumpty]="10.196.1.50" + [teamtalk]="10.196.1.60" + [akkoma]="10.196.1.70" +) + +for container in "${!CONTAINERS[@]}"; do + expected_ip="${CONTAINERS[$container]}" + echo "🔎 Checking $container..." + + # Get actual IP from inside container + actual_ip=$(lxc exec "$container" -- hostname -I | awk '{print $1}') + + # Compare expected vs actual IP + if [[ "$expected_ip" == "$actual_ip" ]]; then + echo "✅ $container IP matches expected: $expected_ip" + else + echo "❌ $container IP mismatch! Expected: $expected_ip, Found: $actual_ip" + fi + + # Ping test from host + echo "📡 Pinging $expected_ip..." + ping -c 2 "$expected_ip" > /dev/null 2>&1 + if [[ $? -eq 0 ]]; then + echo "✅ Ping to $expected_ip successful" + else + echo "❌ Ping to $expected_ip failed" + fi + + # DNS hostname inside container + container_hostname=$(lxc exec "$container" -- hostname) + echo "🌐 $container DNS hostname: $container_hostname" + echo "-------------------------------------------" +done + +echo "🌈 Validation and connectivity tests complete!" |
