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")"