mirror of
				https://github.com/byReqz/stocheck.git
				synced 2025-11-04 12:31:29 +00:00 
			
		
		
		
	update updater to use pregenerated hashes
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
# license: gpl-3
 | 
					# license: gpl-3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh | md5sum | cut -c -32) != $(md5sum $0 | cut -c -32) ]] && [[ -z $1 ]] || [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh | md5sum | cut -c -32) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "--update" ]] || [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh | md5sum | cut -c -32) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "-u" ]];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 | cut -c -32) != $(md5sum $0 | cut -c -32) ]] && [[ $1 != "-u" ]];then
 | 
				
			||||||
  echo "#############################################"
 | 
					  echo "#############################################"
 | 
				
			||||||
  echo -e "\e[4mnote: newer version detected, use -u to update\e[0m"
 | 
					  echo -e "\e[4mnote: newer version detected, use -u to update\e[0m"
 | 
				
			||||||
  echo "#############################################"
 | 
					  echo "#############################################"
 | 
				
			||||||
@@ -140,13 +140,13 @@ while [ -z "$1" ]; do
 | 
				
			|||||||
done
 | 
					done
 | 
				
			||||||
while [ -n "$1" ]; do
 | 
					while [ -n "$1" ]; do
 | 
				
			||||||
      if [[ $1 == "-u" ]] || [[ "$1" == "--update" ]];then
 | 
					      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
 | 
					        if [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) != $(md5sum $0 | cut -c -32) ]];then
 | 
				
			||||||
          wget -O $0 --quiet "https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh"
 | 
					          wget -O $0 --quiet "https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh"
 | 
				
			||||||
          echo "#############################################"
 | 
					          echo "#############################################"
 | 
				
			||||||
          echo -e "\e[4mscript has been updated to the newest version\e[0m"
 | 
					          echo -e "\e[4mscript has been updated to the newest version\e[0m"
 | 
				
			||||||
          echo "#############################################"
 | 
					          echo "#############################################"
 | 
				
			||||||
          exit
 | 
					          exit
 | 
				
			||||||
        elif [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/stocheck.sh | md5sum | cut -c -32) = $(md5sum $0 | cut -c -32) ]];then
 | 
					        elif [[ $(curl -s https://raw.githubusercontent.com/byReqz/stocheck/main/hash) = $(md5sum $0 | cut -c -32) ]];then
 | 
				
			||||||
         echo "#############################################"
 | 
					         echo "#############################################"
 | 
				
			||||||
         echo "no newer version found"
 | 
					         echo "no newer version found"
 | 
				
			||||||
         echo "#############################################"
 | 
					         echo "#############################################"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user