1
0
mirror of https://github.com/byReqz/stocheck.git synced 2024-12-25 18:41:48 +00:00

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

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