2016-08-16 17:15:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-01-27 21:08:50 +00:00
|
|
|
set -e
|
2016-08-16 17:15:06 +00:00
|
|
|
|
2017-03-27 17:10:42 +00:00
|
|
|
VAULT_VERSION="0.7.0"
|
2016-08-16 17:15:06 +00:00
|
|
|
CURDIR=`pwd`
|
|
|
|
|
2017-01-28 00:07:14 +00:00
|
|
|
if [[ $(which vault >/dev/null && vault version | cut -d ' ' -f 2) == "v$VAULT_VERSION" ]]; then
|
2017-01-27 21:08:50 +00:00
|
|
|
echo "Vault v$VAULT_VERSION already installed; Skipping"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2016-08-16 17:15:06 +00:00
|
|
|
echo Fetching Vault ${VAULT_VERSION}...
|
|
|
|
cd /tmp/
|
2017-01-27 21:08:50 +00:00
|
|
|
wget -q https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip -O vault.zip
|
2016-08-16 17:15:06 +00:00
|
|
|
echo Installing Vault...
|
|
|
|
unzip vault.zip
|
|
|
|
sudo chmod +x vault
|
|
|
|
sudo mv vault /usr/bin/vault
|
|
|
|
cd ${CURDIR}
|