diff --git a/scripts/relup-base-packages.sh b/scripts/relup-base-packages.sh index 60785adc8..cb23dcabe 100755 --- a/scripts/relup-base-packages.sh +++ b/scripts/relup-base-packages.sh @@ -70,19 +70,20 @@ otp_vsn_for() { for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do filename="$PROFILE-${tag#[e|v]}-otp$(otp_vsn_for "$tag")-$SYSTEM-$ARCH.zip" url="https://packages.emqx.io/$DIR/$tag/$filename" - if [ ! -f "$filename" ] && curl -L -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then - echo "downloading base package from ${url} ..." - curl -L -o "${filename}" "${url}" - if [ "$SYSTEM" != "centos6" ]; then - echo "downloading sha256 sum from ${url}.sha256 ..." - curl -L -o "${filename}.sha256" "${url}.sha256" - SUMSTR=$(cat "${filename}.sha256") - echo "got sha265sum: ${SUMSTR}" - ## https://askubuntu.com/questions/1202208/checking-sha256-checksum - echo "${SUMSTR} ${filename}" | $SHASUM -c || exit 1 - fi - else - echo "file $filename already downloaded or doesn't exist in the archives; skipping it" + echo "downloading base package from ${url} ..." + if [ -f "$filename" ]; then + echo "file $filename already downloaded; skikpped" + continue + fi + echo "downloading base package from ${url} ..." + curl -L -o "${filename}" "${url}" + if [ "$SYSTEM" != "centos6" ]; then + echo "downloading sha256 sum from ${url}.sha256 ..." + curl -L -o "${filename}.sha256" "${url}.sha256" + SUMSTR=$(cat "${filename}.sha256") + echo "got sha265sum: ${SUMSTR}" + ## https://askubuntu.com/questions/1202208/checking-sha256-checksum + echo "${SUMSTR} ${filename}" | $SHASUM -c || exit 1 fi done