fixed nvme drive counting

This commit is contained in:
Nils 2021-03-05 17:38:07 +01:00
parent d82cef27df
commit 592bb244bc
Signed by: byreqz
GPG Key ID: 396A62D7D436749E
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ while [ -z "$1" ]; do
if [[ -n $(ls /dev | grep nvme) ]];then
echo "=== nvme drive check: ==="
echo "-------------------------"
echo "$(ls -l /dev | grep nvme | wc -l) Drives found"
echo "$(ls -l /sys/block | grep nvme | wc -l) Drives found"
echo "-------------------------"
for x in {0..4};do
scan=$(smartctl --scan)
@ -57,7 +57,7 @@ while [ -z "$1" ]; do
exit
fi
fi
if [[ -n $(ls /dev | grep nvme) ]] || [[ -n $(ls /sys/block | grep sd) ]] || [[ ! "$raidcheck" =~ "3ware" ]] && [[ "$raidcheck" =~ "adaptec" ]] && [[ "$raidcheck" =~ "lsi" ]] && [[ -n $(ls /sys/block | grep sd) ]] && [[ -n $(ls /dev | grep nvme) ]];then
if [[ -n $(ls /sys/block | grep nvme) ]] || [[ -n $(ls /sys/block | grep sd) ]] || [[ ! "$raidcheck" =~ "3ware" ]] && [[ "$raidcheck" =~ "adaptec" ]] && [[ "$raidcheck" =~ "lsi" ]] && [[ -n $(ls /sys/block | grep sd) ]] && [[ -n $(ls /dev | grep nvme) ]];then
echo "no drives detected"
exit
fi