chore: add more debug info for relup-base-packages.sh

This commit is contained in:
Shawn 2022-02-18 22:41:03 +08:00
parent c3cb04c229
commit 3690d1951e
1 changed files with 4 additions and 2 deletions

View File

@ -56,13 +56,15 @@ pushd _upgrade_base
for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do
filename="$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip" filename="$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip"
url="https://www.emqx.com/downloads/$DIR/$tag/$filename" url="https://www.emqx.com/downloads/$DIR/$tag/$filename"
echo "downloading ${filename} ..." echo "downloading base package from ${url} ..."
if [ ! -f "$filename" ] && curl -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then if [ ! -f "$filename" ] && curl -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then
curl -L -o "${filename}" "${url}" curl -L -o "${filename}" "${url}"
if [ "$SYSTEM" != "centos6" ]; then if [ "$SYSTEM" != "centos6" ]; then
curl -L -o "${filename}.sha256" "${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 ## https://askubuntu.com/questions/1202208/checking-sha256-checksum
echo "$(cat "${filename}.sha256") ${filename}" | $SHASUM -c || exit 1 echo "${SUMSTR} ${filename}" | $SHASUM -c || exit 1
fi fi
fi fi
done done