From b7d44a76b9dc1913a15b174f63f4bb41db99b72a Mon Sep 17 00:00:00 2001 From: Nils <32552517+byReqz@users.noreply.github.com> Date: Mon, 1 Feb 2021 12:59:52 +0000 Subject: [PATCH] fix updater when checking remote machine --- stocheck.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/stocheck.sh b/stocheck.sh index 3e35985..0990946 100644 --- a/stocheck.sh +++ b/stocheck.sh @@ -1,11 +1,12 @@ #!/bin/bash # license: gpl-3 - -if [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]] && [[ -z $1 ]] || [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "--update" ]] || [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "-u" ]];then - echo "#############################################" - echo -e "\e[4mnote: newer version detected, use -u to update\e[0m" - echo "#############################################" - echo "" +if [[ ! "$0" =~ "bash" ]];then + if [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]] && [[ -z $1 ]] || [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "--update" ]] || [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "-u" ]];then + echo "#############################################" + echo -e "\e[4mnote: newer version detected, use -u to update\e[0m" + echo "#############################################" + echo "" + fi fi while [ -z "$1" ]; do raidcheck="$(lspci | grep -E 'LSI|3Ware|Adaptec|Smartraid')"