Skip to content

Instantly share code, notes, and snippets.

@leadelngalame1611
Created February 25, 2023 23:53
Show Gist options
  • Save leadelngalame1611/b213f001c23b626f89215c6e46f512aa to your computer and use it in GitHub Desktop.
Save leadelngalame1611/b213f001c23b626f89215c6e46f512aa to your computer and use it in GitHub Desktop.
verify sig before downlaoding the aws command line tool
#!/usr/bin/env bash
set -Eeo pipefail
function check_sig() {
gpg --import ./ci/synced/aws-cli/aws_pub_key.txt \
&& curl -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip.sig \
&& gpg --verify awscliv2.sig awscliv2.zip \
&& echo "GOOD" || echo "BAD"
}
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
if [[ $(check_sig) == "GOOD" ]];then
echo "Signature looks good!"
unzip awscliv2.zip
sudo ./aws/install || sudo ./aws/install --update
else
echo "Couldn't verify aws cli!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment