Skip to content

Instantly share code, notes, and snippets.

@mario21ic
Forked from afym/ hashicorp.sh
Created April 12, 2017 16:24
Show Gist options
  • Save mario21ic/cc8b9cbbcbc9efc81f6f604dd7eedb7b to your computer and use it in GitHub Desktop.
Save mario21ic/cc8b9cbbcbc9efc81f6f604dd7eedb7b to your computer and use it in GitHub Desktop.
Install hashicorp tools in an easy way (terraform, packer, ...)
#!/bin/sh
TOOL_NAME=$1
ZIP_URL=$2
mkdir /tmp/$TOOL_NAME
cd /tmp/$TOOL_NAME
curl -sS $ZIP_URL > $TOOL_NAME.zip
unzip $TOOL_NAME.zip
sudo cp $TOOL_NAME /usr/local/bin/$TOOL_NAME
rm -rf /tmp/$TOOL_NAME
echo "$TOOL_NAME :: is installed successfully"
# sample installing terraform
$ chmod +x /hashicorp.sh
$ ./hashicorp.sh terraform https://releases.hashicorp.com/terraform/0.9.2/terraform_0.9.2_linux_amd64.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment