Skip to content

Instantly share code, notes, and snippets.

@alexolinux
Created May 7, 2024 17:35
Show Gist options
  • Save alexolinux/c5920a48a6bd14237be2b433677512e8 to your computer and use it in GitHub Desktop.
Save alexolinux/c5920a48a6bd14237be2b433677512e8 to your computer and use it in GitHub Desktop.
Installation of granted for AWS account profile management
#!/bin/bash
#https://docs.commonfate.io/granted/getting-started#verify-the-installation
GRANTED_HOME="/usr/local/granted"
DEST="/usr/local/bin"
TTMP="/tmp/tarball"
clear && \
mkdir $TTMP && cd $TTMP && \
curl -OL https://releases.commonfate.io/granted/v0.21.1/granted_0.21.1_linux_x86_64.tar.gz
if [ "$?" -eq 0 ]; then
printf "Granted downloaded successfully. Uncompressing to destination folder..."
sudo mkdir "${GRANTED_HOME}"
sudo tar -xzvf granted_0.21.1_linux_x86_64.tar.gz -C "${GRANTED_HOME}"
sudo ln -s "${GRANTED_HOME}/granted" "${DEST}"
if [ "$?" -eq 0 ]; then
"Granted has been installed succesfully!"
granted -v
else
printf "Failure during the installation process. Granted not installed."
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment