mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 12:16:53 +00:00
Update disk-passthrough.sh
This commit is contained in:
parent
ae1bd16f07
commit
81952226bb
@ -172,11 +172,17 @@ while read -r DISK; do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
USED_BY=""
|
||||||
|
REAL_PATH=$(readlink -f "$DISK")
|
||||||
|
|
||||||
USED_BY=""
|
# Buscar el disco por su ruta real y por su symlink /by-id (si lo tiene)
|
||||||
if grep -q "$DISK" <(find /etc/pve/qemu-server /etc/pve/lxc -type f -exec cat {} +); then
|
DISK_BYID=$(find /dev/disk/by-id/ -xtype l -exec bash -c 'readlink -f "$1"' _ {} \; | grep -F "$REAL_PATH" | head -n1)
|
||||||
USED_BY="[in use ct or vm]"
|
|
||||||
fi
|
CONFIG_DUMP=$(find /etc/pve/qemu-server /etc/pve/lxc -type f -exec cat {} + 2>/dev/null)
|
||||||
|
|
||||||
|
if grep -qF "$REAL_PATH" <<< "$CONFIG_DUMP" || [[ -n "$DISK_BYID" && "$CONFIG_DUMP" == *"$DISK_BYID"* ]]; then
|
||||||
|
USED_BY="[en uso]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user