From 03c6051ba3f8c7425da47b16ab703d3953ea8787 Mon Sep 17 00:00:00 2001 From: Nils Date: Sat, 15 May 2021 20:18:28 +0200 Subject: [PATCH] fix detection and loop issue --- stocheck.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/stocheck.sh b/stocheck.sh index 289120a..33974ff 100755 --- a/stocheck.sh +++ b/stocheck.sh @@ -106,13 +106,8 @@ while [ -z "$1" ]; do echo "------------------- /dev/sd"$x" --------------------" echo -e "drive is not responding" echo "-------------------------------------------------" - else - exit fi done - if [[ -z $(ls /dev | grep nvme) ]];then - exit - fi fi if [[ -n $(ls /dev | grep nvme) ]];then echo "=== nvme drive check: ($(ls -l /sys/block | grep nvme | wc -l) found) ===" @@ -150,14 +145,12 @@ while [ -z "$1" ]; do echo "-------------------------------------------------" fi done - if [[ -z $(ls /dev | grep sd) ]];then - exit - fi fi 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 + exit elif [[ -n $(echo "$raidcheck" | grep -e "3ware") ]];then echo "3ware raid-controller detected" dreiware=$(tw_cli show | grep c | cut -c -3)