From b082f8a08e3b4e597bf069306194f597709c469c Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 19 Feb 2024 04:43:10 -0500 Subject: [PATCH] Update fstrim.sh display CTID instead of hostname --- misc/fstrim.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc/fstrim.sh b/misc/fstrim.sh index b3fc2c52..6b445667 100644 --- a/misc/fstrim.sh +++ b/misc/fstrim.sh @@ -44,9 +44,8 @@ excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title " function trim_container() { local container=$1 - local name=$(pct exec "$container" hostname 2>/dev/null || echo "No hostname because the container is not running") header_info - echo -e "${BL}[Info]${GN} Trimming ${name} ${CL} \n" + echo -e "${BL}[Info]${GN} Trimming ${container} ${CL} \n" local before_trim=$(lvs | awk -F '[[:space:]]+' 'NR>1 && (/Data%|'"vm-$container"'/) {gsub(/%/, "", $7); print $7}') echo -e "${RD}Data before trim $before_trim%${CL}" pct fstrim $container @@ -66,7 +65,7 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do template=$(pct config $container | grep -q "template:" && echo "true" || echo "false") if [ "$template" == "true" ]; then header_info - echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container is a template ${CL} \n" + echo -e "${BL}[Info]${GN} Skipping ${container} ${RD}$container is a template ${CL} \n" sleep 1 continue fi