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