From 73cdf4f2bdc97dbf9f4b1ebd80b928bb807e71ae Mon Sep 17 00:00:00 2001 From: Nils <32552517+byReqz@users.noreply.github.com> Date: Sun, 24 Jan 2021 20:47:09 +0000 Subject: [PATCH] fixed controller detection --- stocheck.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stocheck.sh b/stocheck.sh index 0524f0e..b235db4 100644 --- a/stocheck.sh +++ b/stocheck.sh @@ -7,8 +7,8 @@ if [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck. echo "#############################################" echo "" fi -while [ ! -n "$1" ]; do - raidcheck="$(lspci)" +while [ -z "$1" ]; do + raidcheck="$(lspci | grep -E 'lsi|3ware|adaptec|smartraid')" if [[ -z "$raidcheck" ]];then if [[ -n $(ls /sys/block | grep sd) ]];then echo "=== sata drive check: ===" @@ -138,8 +138,7 @@ while [ ! -n "$1" ]; do exit fi done -exit -while [ ! -z "$1" ]; do +while [ -n "$1" ]; do if [[ $1 == "-u" ]] || [[ "$1" == "--update" ]];then if [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh | md5sum | cut -c -32) != $(md5sum $0 | cut -c -32) ]];then wget -O $0 --quiet "https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh" @@ -159,5 +158,11 @@ while [ ! -z "$1" ]; do echo " -u/--update -- update the script" echo " -h/--help -- show help" exit + else + echo "Usage: $0 (options) (y/n)" + echo "Options:" + echo " -u/--update -- update the script" + echo " -h/--help -- show help" + exit fi -done +done \ No newline at end of file