mirror of
https://github.com/XTLS/Xray-install.git
synced 2024-11-21 23:01:27 +00:00
Fix hash check
This commit is contained in:
parent
117226f969
commit
046d9aa243
|
@ -429,14 +429,12 @@ download_xray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verification of Xray archive
|
# Verification of Xray archive
|
||||||
for LISTSUM in 'md5' 'sha1' 'sha256' 'sha512'; do
|
CHECKSUM=$(cat "$ZIP_FILE".dgst | awk -F '= ' '/256=/ {print $2}')
|
||||||
SUM="$(${LISTSUM}sum "$ZIP_FILE" | sed 's/ .*//')"
|
LOCALSUM=$(sha256sum "$ZIP_FILE" | awk '{printf $1}')
|
||||||
CHECKSUM="$(grep ${LISTSUM^^} "$ZIP_FILE".dgst | grep "$SUM" -o -a | uniq)"
|
if [[ "$CHECKSUM" != "$LOCALSUM" ]]; then
|
||||||
if [[ "$SUM" != "$CHECKSUM" ]]; then
|
echo 'error: SHA256 check failed! Please check your network or try again.'
|
||||||
echo 'error: Check failed! Please check your network or try again.'
|
return 1
|
||||||
return 1
|
fi
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
decompression() {
|
decompression() {
|
||||||
|
|
Loading…
Reference in a new issue