pull/86/head
Markson Hon 2023-02-05 16:37:07 +08:00 committed by yuhan6665
parent 00974924bf
commit cfddeb5115
1 changed files with 6 additions and 8 deletions

View File

@ -87,14 +87,12 @@ download_xray() {
} }
verification_xray() { verification_xray() {
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 $(echo $LISTSUM | tr [:lower:] [:upper:]) $ZIP_FILE.dgst | uniq | sed 's/.* //')" 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
exit 1
fi fi
done
} }
decompression() { decompression() {