From 15ecacd2513453ae0991757f5af536e1a533a567 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 8 Apr 2025 20:33:51 +0200 Subject: [PATCH] update disk-passthrough.sh --- scripts/disk-passthrough.sh | 2 +- scripts/disk-passthrough_ct.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/disk-passthrough.sh b/scripts/disk-passthrough.sh index 5a1a53f..336bec5 100644 --- a/scripts/disk-passthrough.sh +++ b/scripts/disk-passthrough.sh @@ -174,7 +174,7 @@ while read -r DISK; do USED_BY="" REAL_PATH=$(readlink -f "$DISK") - CONFIG_DATA=$(cat /etc/pve/qemu-server/*.conf /etc/pve/lxc/*.conf 2>/dev/null) + CONFIG_DATA=$(grep -vE '^\s*#' /etc/pve/qemu-server/*.conf /etc/pve/lxc/*.conf 2>/dev/null) if grep -Fq "$REAL_PATH" <<< "$CONFIG_DATA"; then USED_BY="⚠ $(translate "In use")" diff --git a/scripts/disk-passthrough_ct.sh b/scripts/disk-passthrough_ct.sh index 46671e0..deb96ca 100644 --- a/scripts/disk-passthrough_ct.sh +++ b/scripts/disk-passthrough_ct.sh @@ -220,7 +220,8 @@ while read -r DISK; do USED_BY="" REAL_PATH=$(readlink -f "$DISK") - CONFIG_DATA=$(cat /etc/pve/qemu-server/*.conf /etc/pve/lxc/*.conf 2>/dev/null) + CONFIG_DATA=$(grep -vE '^\s*#' /etc/pve/qemu-server/*.conf /etc/pve/lxc/*.conf 2>/dev/null) + if grep -Fq "$REAL_PATH" <<< "$CONFIG_DATA"; then USED_BY="⚠ $(translate "In use")"