diff options
Diffstat (limited to 'reorder_override.sh')
| -rwxr-xr-x | reorder_override.sh | 30 |
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 |
