This commit is contained in:
teldra 2022-09-12 11:09:17 +02:00
parent 5ca818d90a
commit 4ab6b0f28c
1 changed files with 11 additions and 7 deletions

18
main.sh
View File

@ -41,14 +41,18 @@ target_phy_disk() {
target_phy_id() {
local i
local f2
for i in $(find /dev/disk/by-id ! -type d | grep -v part); do
if realpath "${i}" | grep -q -i "${TARGET_PHY_DISK}"; then
if echo "${i}" | grep -v "wwn" | grep -q -v "eui"; then
TARGET_PHY_ID="${i}"
f2="1"
if ! grep -q vd "${TARGET_PHY_DISK}"
for i in $(find /dev/disk/by-id ! -type d | grep -v part); do
if realpath "${i}" | grep -q -i "${TARGET_PHY_DISK}"; then
if echo "${i}" | grep -v "wwn" | grep -q -v "eui"; then
TARGET_PHY_ID="${i}"
f2="1"
fi
fi
fi
done
done
else
TARGET_PHY_ID="/dev/${TARGET_PHY_DISK}"
fi
if [ "$f2" == "1" ]; then
return 0
else