Skip to content

Commit

Permalink
Update download md5 check logic (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyShi22 authored May 12, 2020
1 parent fbd85f0 commit e0de0cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/download_console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ download_release_pkg()
fi

# download
if [ ! -f "${release_pkg}" ] || [ -z "$(md5sum -c ${release_pkg_checksum_file}|grep OK)" ];then
if [ ! -f "${release_pkg}" ] || [ "$(md5sum -c ${release_pkg_checksum_file}|echo $?)" -ne "0" ];then

LOG_INFO "Try to download from: ${cdn_url}/${compatibility_version}/${release_pkg}"
if ! curl --fail -LO ${cdn_url}/${compatibility_version}/${release_pkg}; then
Expand All @@ -121,7 +121,7 @@ download_release_pkg()
curl -C - -LO ${github_url}/${compatibility_version}/${release_pkg}
fi

if [ -z "$(md5sum -c ${release_pkg_checksum_file}|grep OK)" ]; then
if [ "$(md5sum -c ${release_pkg_checksum_file}|echo $?)" -ne "0" ]; then
LOG_ERROR "Download package error"
rm -f ${release_pkg}
exit 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/download_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ download_release_pkg()
fi

# download
if [ ! -f "${release_pkg}" ] || [ -z "$(md5sum -c ${release_pkg_checksum_file}|grep OK)" ];then
if [ ! -f "${release_pkg}" ] || [ "$(md5sum -c ${release_pkg_checksum_file}|echo $?)" -ne "0" ];then

LOG_INFO "Try to download from: ${cdn_url}/${compatibility_version}/${release_pkg}"
if ! curl --fail -LO ${cdn_url}/${compatibility_version}/${release_pkg}; then
Expand All @@ -105,7 +105,7 @@ download_release_pkg()
curl -C - -LO ${github_url}/${compatibility_version}/${release_pkg}
fi

if [ -z "$(md5sum -c ${release_pkg_checksum_file}|grep OK)" ]; then
if [ "$(md5sum -c ${release_pkg_checksum_file}|echo $?)" -ne "0" ]; then
LOG_ERROR "Download package error"
rm -f ${release_pkg}
exit 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/download_wecross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ download_release_pkg()
fi

# download
if [ ! -f "${release_pkg}" ] || [ -z "$(md5sum -c ${release_pkg_checksum_file}|grep OK)" ];then
if [ ! -f "${release_pkg}" ] || [ "$(md5sum -c ${release_pkg_checksum_file}|echo $?)" -ne "0" ];then

LOG_INFO "Try to download from: ${cdn_url}/${compatibility_version}/${release_pkg}"
if ! curl --fail -LO ${cdn_url}/${compatibility_version}/${release_pkg}; then
Expand All @@ -151,7 +151,7 @@ download_release_pkg()
curl -C - -LO ${github_url}/${compatibility_version}/${release_pkg}
fi

if [ -z "$(md5sum -c ${release_pkg_checksum_file}|grep OK)" ]; then
if [ "$(md5sum -c ${release_pkg_checksum_file}|echo $?)" -ne "0" ]; then
LOG_ERROR "Download package error"
rm -f ${release_pkg}
exit 1
Expand Down

0 comments on commit e0de0cb

Please sign in to comment.