try to modify the check instruction

pull/1/head
Dct Mei 2020-03-16 15:27:52 +08:00
parent 2278203c14
commit 4b7faf1d11
No known key found for this signature in database
GPG Key ID: 50BF8B712DCAD7EA
1 changed files with 2 additions and 2 deletions

View File

@ -155,8 +155,8 @@ downloadV2Ray(){
colorEcho ${RED} "Failed to download! Please check your network or try again."
return 3
fi
for LISTSUM in 'md5sum' 'sha1sum' 'sha256sum' 'sha512sum'; do
SUM="$($LISTSUM $ZIPFILE | sed 's/.* //')"
for LISTSUM in 'md5' 'sha1' 'sha256' 'sha512'; do
SUM="$(${LISTSUM}sum $ZIPFILE | sed 's/.* //')"
CHECKSUM="$(grep ${LISTSUM^^} $ZIPFILE.dgst | sed 's/.* //')"
if [[ "$SUM" != "$CHECKSUM" ]]; then
colorEcho "$RED" 'Check failed! Please check your network or try again.'