Fix hash check (#263)
* Fix hash check * chore Co-authored-by: Markson <markson@2333ma.top> Co-authored-by: IceCodeNew <32576256+IceCodeNew@users.noreply.github.com>pull/269/head
parent
c8bc8dd17d
commit
b4035a8eb2
|
@ -302,14 +302,12 @@ download_v2ray() {
|
|||
fi
|
||||
|
||||
# Verification of V2Ray archive
|
||||
for LISTSUM in 'md5' 'sha1' 'sha256' 'sha512'; do
|
||||
SUM="$(${LISTSUM}sum "$ZIP_FILE" | sed 's/ .*//')"
|
||||
CHECKSUM="$(grep ${LISTSUM^^} "$ZIP_FILE".dgst | grep "$SUM" -o -a | uniq)"
|
||||
if [[ "$SUM" != "$CHECKSUM" ]]; then
|
||||
echo 'error: Check failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
CHECKSUM=$(awk -F '= ' '/256=/ {print $2}' < "${ZIP_FILE}.dgst")
|
||||
LOCALSUM=$(sha256sum "$ZIP_FILE" | awk '{printf $1}')
|
||||
if [[ "$CHECKSUM" != "$LOCALSUM" ]]; then
|
||||
echo 'error: SHA256 check failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
decompression() {
|
||||
|
|
Loading…
Reference in New Issue