tooz/setup-consul-env.sh
Julien Danjou 4906e72416 Use pifpaf to setup daemons
Depends-On: Id3e6b694bb186724517599cd9875ad80ceeee053
Change-Id: I2265b4b83f136f2eeb21e86cda1c7ec36401d0a8
2016-06-09 10:40:16 +02:00

28 lines
741 B
Bash
Executable File

#!/bin/bash
set -eux
if [ -z "$(which consul)" ]; then
CONSUL_VERSION=0.6.3
CONSUL_RELEASE_URL=https://releases.hashicorp.com/consul
case `uname -s` in
Darwin)
consul_file="consul_${CONSUL_VERSION}_darwin_amd64.zip"
;;
Linux)
consul_file="consul_${CONSUL_VERSION}_linux_amd64.zip"
;;
*)
echo "Unknown operating system"
exit 1
;;
esac
consul_dir=`basename $consul_file .zip`
mkdir -p $consul_dir
curl -L $CONSUL_RELEASE_URL/$CONSUL_VERSION/$consul_file > $consul_dir/$consul_file
unzip $consul_dir/$consul_file -d $consul_dir
export PATH=$PATH:$consul_dir
fi
# Yield execution to venv command
$*