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

32 lines
724 B
Bash
Executable File

#!/bin/bash
set -eux
if [ -z "$(which etcd)" ]; then
ETCD_VERSION=2.2.2
case `uname -s` in
Darwin)
OS=darwin
SUFFIX=zip
;;
Linux)
OS=linux
SUFFIX=tar.gz
;;
*)
echo "Unsupported OS"
exit 1
esac
case `uname -m` in
x86_64)
MACHINE=amd64
;;
*)
echo "Unsupported machine"
exit 1
esac
TARBALL_NAME=etcd-v${ETCD_VERSION}-$OS-$MACHINE
test ! -d "$TARBALL_NAME" && curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${TARBALL_NAME}.${SUFFIX} | tar xz
export PATH=$PATH:$TARBALL_NAME
fi
$*