Created
February 25, 2023 23:53
-
-
Save leadelngalame1611/b213f001c23b626f89215c6e46f512aa to your computer and use it in GitHub Desktop.
verify sig before downlaoding the aws command line tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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