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() { target_phy_id() {
local i local i
local f2 local f2
for i in $(find /dev/disk/by-id ! -type d | grep -v part); do if ! grep -q vd "${TARGET_PHY_DISK}"
if realpath "${i}" | grep -q -i "${TARGET_PHY_DISK}"; then for i in $(find /dev/disk/by-id ! -type d | grep -v part); do
if echo "${i}" | grep -v "wwn" | grep -q -v "eui"; then if realpath "${i}" | grep -q -i "${TARGET_PHY_DISK}"; then
TARGET_PHY_ID="${i}" if echo "${i}" | grep -v "wwn" | grep -q -v "eui"; then
f2="1" TARGET_PHY_ID="${i}"
f2="1"
fi
fi fi
fi done
done else
TARGET_PHY_ID="/dev/${TARGET_PHY_DISK}"
fi
if [ "$f2" == "1" ]; then if [ "$f2" == "1" ]; then
return 0 return 0
else else