From c702652a000056c0d9189bffa8b6111b5088b0bd Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 17 Feb 2024 15:59:54 -0500 Subject: [PATCH] Update fstrim.sh tweak --- misc/fstrim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/fstrim.sh b/misc/fstrim.sh index e413961a..06430eee 100644 --- a/misc/fstrim.sh +++ b/misc/fstrim.sh @@ -44,7 +44,7 @@ excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title " function trim_container() { local container=$1 - local name=$(pct exec "$container" hostname) + 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" local before_trim=$(lvs | awk -F '[[:space:]]+' 'NR>1 && (/Data%|'"$container"'/) {gsub(/%/, "", $7); print $7}')