From 592bb244bc6e96caa8c4559ea34dab3262a4a96d Mon Sep 17 00:00:00 2001 From: Nils Date: Fri, 5 Mar 2021 17:38:07 +0100 Subject: [PATCH] fixed nvme drive counting --- stocheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stocheck.sh b/stocheck.sh index cce0c31..a6974b2 100644 --- a/stocheck.sh +++ b/stocheck.sh @@ -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