forked from boot2docker/boot2docker-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdownload.sh
More file actions
43 lines (36 loc) · 1.04 KB
/
download.sh
File metadata and controls
43 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -e
# Set version to latest unless set by user
if [ -z "$VERSION" ]; then
VERSION="1.1.2"
fi
EXTENSION=""
echo "Downloading version ${VERSION}..."
# OS information (contains e.g. Darwin x86_64)
UNAME=`uname -a`
# Determine platform
if [[ $UNAME == *"Darwin"* ]]; then
PLATFORM="darwin"
elif [[ ($UNAME == *MINGW*) || ($UNAME == *Cygwin*) ]]; then
PLATFORM="windows"
EXTENSION=".exe"
UNAME="${PROCESSOR_ARCHITEW6432}"
else
PLATFORM="linux"
fi
# Determine architecture
if [[ ($UNAME == *x86_64*) || ($UNAME == *amd64*) || ($UNAME == *AMD64*) ]]
then
ARCH="amd64"
else
echo "Currently, there are no 32bit binaries provided."
echo "You will need to go get / go install github.com/boot2docker/boot2docker-cli."
exit 1
fi
# Download binary
URL="https://github.com/boot2docker/boot2docker-cli/releases/download/v${VERSION}/boot2docker-v${VERSION}-${PLATFORM}-${ARCH}${EXTENSION}"
echo "Downloading $URL"
curl -L -o "boot2docker${EXTENSION}" "$URL"
# Make binary executable
chmod +x "boot2docker${EXTENSION}"
echo "Done."