From aee311706eb7475818c7535c82870228d37afe48 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 14 Mar 2023 08:01:43 -0400 Subject: [PATCH] Update clean-lxcs.sh skip non Debian/Ubuntu containers --- misc/clean-lxcs.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/clean-lxcs.sh b/misc/clean-lxcs.sh index 0456383d..0273c2e3 100644 --- a/misc/clean-lxcs.sh +++ b/misc/clean-lxcs.sh @@ -5,7 +5,7 @@ # License: MIT # https://github.com/tteck/Proxmox/raw/main/LICENSE -function header_info { +function header_info() { clear cat <<"EOF" ________ __ _ ________ @@ -44,6 +44,13 @@ function clean_container() { } for container in $containers; do + os=$(pct config "$container" | awk '/^ostype/ {print $2}') + if [ "$os" != "debian" ] && [ "$os" != "ubuntu" ]; then + header_info + echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container is not Debian or Ubuntu ${CL} \n" + sleep 1 + continue + fi status=$(pct status $container) template=$(pct config $container | grep -q "template:" && echo "true" || echo "false") if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then