mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-13 02:48:10 +00:00
Feature: LXC-Delete (pve helper): add "all items" (#4296)
This commit is contained in:
parent
245b35d01e
commit
b333d8c3f9
@ -50,7 +50,7 @@ if [ -z "$containers" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
menu_items=()
|
menu_items=("ALL" "Delete ALL containers" "OFF") # Add as first option
|
||||||
FORMAT="%-10s %-15s %-10s"
|
FORMAT="%-10s %-15s %-10s"
|
||||||
|
|
||||||
while read -r container; do
|
while read -r container; do
|
||||||
@ -76,6 +76,11 @@ DELETE_MODE=${DELETE_MODE:-m}
|
|||||||
|
|
||||||
selected_ids=$(echo "$CHOICES" | tr -d '"' | tr -s ' ' '\n')
|
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
|
for container_id in $selected_ids; do
|
||||||
status=$(pct status $container_id)
|
status=$(pct status $container_id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user