summaryrefslogtreecommitdiff
path: root/reorder_override.sh
diff options
context:
space:
mode:
authordoc <doc@filenotfound.org>2025-09-16 11:30:38 +0000
committerdoc <doc@filenotfound.org>2025-09-16 11:30:38 +0000
commit5cfeb2cf156705349730bdc6ce883fd8eb22e728 (patch)
tree13758f78513ed74198d2257c11c0ef9a913725d1 /reorder_override.sh
first commitHEADmaster
Diffstat (limited to 'reorder_override.sh')
-rwxr-xr-xreorder_override.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/reorder_override.sh b/reorder_override.sh
new file mode 100755
index 0000000..35edb2f
--- /dev/null
+++ b/reorder_override.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+echo "Reassigning container IPs in increments of 10..."
+
+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"
+)
+
+for container in "${!CONTAINERS[@]}"; do
+ new_ip="${CONTAINERS[$container]}"
+ echo "➑️ Overriding eth0 device for $container..."
+ lxc config device override "$container" eth0
+ echo "πŸ”§ Setting $container to IP $new_ip..."
+ lxc config device set "$container" eth0 ipv4.address "$new_ip"
+done
+
+echo "πŸ”„ Restarting containers to apply new IPs..."
+for container in "${!CONTAINERS[@]}"; do
+ echo "πŸ”„ Restarting $container..."
+ lxc restart "$container"
+done
+
+echo "βœ… IP assignment complete! Here’s the new layout:"
+lxc list