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-07-03 23:43:47 +00:00
|
|
|
CONSUL_VERSION="0.8.5"
|
2016-08-16 17:15:06 +00:00
|
|
|
CURDIR=`pwd`
|
|
|
|
|
2017-01-28 00:07:14 +00:00
|
|
|
if [[ $(which consul >/dev/null && consul version | head -n 1 | cut -d ' ' -f 2) == "v$CONSUL_VERSION" ]]; then
|
2017-01-27 21:08:50 +00:00
|
|
|
echo "Consul v$CONSUL_VERSION already installed; Skipping"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2016-08-16 17:15:06 +00:00
|
|
|
echo Fetching Consul...
|
|
|
|
cd /tmp/
|
2017-01-27 21:08:50 +00:00
|
|
|
wget -q https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip -O consul.zip
|
2016-08-16 17:15:06 +00:00
|
|
|
echo Installing Consul...
|
|
|
|
unzip consul.zip
|
|
|
|
sudo chmod +x consul
|
|
|
|
sudo mv consul /usr/bin/consul
|
|
|
|
cd ${CURDIR}
|