From 5cfeb2cf156705349730bdc6ce883fd8eb22e728 Mon Sep 17 00:00:00 2001 From: doc Date: Tue, 16 Sep 2025 11:30:38 +0000 Subject: first commit --- reorder_validation.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 reorder_validation.sh (limited to 'reorder_validation.sh') 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!" -- cgit v1.2.3