Skip to content

Commit

Permalink
use sha256 to verify
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Chang committed Dec 17, 2024
1 parent b341053 commit 9ea3234
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion dev-infrastructure/scripts/istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,26 @@ if [[ -z "$TARGET_VERSION" ]]; then
fi

echo "********** Download istioctl**************"
curl -L "{$ISTIOCTL_URL}" | ISTIO_VERSION="${ISTIOCTL_VERSION}" TARGET_ARCH=x86_64 sh -
ISTIO_URL="https://github.com/istio/istio/releases/download/${ISTIOCTL_VERSION}/istio-${ISTIOCTL_VERSION}-linux-amd64.tar.gz"
SHA256_URL="https://github.com/istio/istio/releases/download/${ISTIOCTL_VERSION}/istio-${ISTIOCTL_VERSION}-linux-amd64.tar.gz.sha256"
# Download the Istioctl binary
wget $ISTIO_URL -O istio-"${ISTIOCTL_VERSION}"-linux-amd64.tar.gz

# Download the SHA-256 checksum file
wget $SHA256_URL -O istio-"${ISTIOCTL_VERSION}"-linux-amd64.tar.gz.sha256

# Verify the downloaded file
sha256sum -c istio-"${ISTIOCTL_VERSION}"-linux-amd64.tar.gz.sha256

# Check the result of the verification
if [ $? -eq 0 ]; then
echo "Verification successful: The file is intact."
else
echo "Verification failed: The file is corrupted."
exit 1
fi

# curl -L "{$ISTIOCTL_URL}" | ISTIO_VERSION="${ISTIOCTL_VERSION}" TARGET_ARCH=x86_64 sh -
cd istio-"${ISTIOCTL_VERSION}"
export PATH=$PWD/bin:$PATH
echo "=========================================================================="
Expand Down

0 comments on commit 9ea3234

Please sign in to comment.