#!/bin/bash

# Check if correct number of arguments is provided
if [ "$#" -ne 2 ]; then
    echo "Usage: $0 <start_vmid> <end_vmid>"
    exit 1
fi

start_vmid=$1
end_vmid=$2

# Loop through the range and destroy each container
for ((vmid=start_vmid; vmid<=end_vmid; vmid++)); do
    echo "Destroying LXC container $vmid..."
    pct destroy $vmid
    echo "LXC container $vmid destroyed."
done

echo "All specified LXC containers have been destroyed."
