1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-05-13 02:07:57 +00:00

Feature: LXC-Delete (pve helper): add "all items" (#4296)

This commit is contained in:
CanbiZ 2025-05-12 15:58:14 +02:00 committed by GitHub
parent 245b35d01e
commit b333d8c3f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ if [ -z "$containers" ]; then
exit 1
fi
menu_items=()
menu_items=("ALL" "Delete ALL containers" "OFF") # Add as first option
FORMAT="%-10s %-15s %-10s"
while read -r container; do
@ -76,6 +76,11 @@ DELETE_MODE=${DELETE_MODE:-m}
selected_ids=$(echo "$CHOICES" | tr -d '"' | tr -s ' ' '\n')
# If "ALL" is selected, override with all container IDs
if echo "$selected_ids" | grep -q "^ALL$"; then
selected_ids=$(echo "$containers" | awk '{print $1}')
fi
for container_id in $selected_ids; do
status=$(pct status $container_id)