1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-28 10:15:23 +00:00
v2fly/release/install.sh

37 lines
785 B
Bash
Raw Normal View History

2015-09-18 09:19:52 +00:00
#!/bin/bash
2015-10-02 09:01:12 +00:00
GO_AMD64=https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz
GO_X86=https://storage.googleapis.com/golang/go1.5.1.linux-386.tar.gz
ARCH=$(uname -m)
GO_CUR=${GO_AMD64}
2015-10-02 09:05:44 +00:00
if [ "$ARCH" == "i686" ] || [ "$ARCH" == "i386" ]; then
2015-10-02 09:01:12 +00:00
GO_CUR=${GO_X86}
fi
2015-09-18 09:19:52 +00:00
function git_not_installed {
git --version 2>&1 >/dev/null
GIT_IS_AVAILABLE=$?
return $GIT_IS_AVAILABLE
}
if [ git_not_installed ]; then
apt-get install git -y
fi
if [ -z "$GOPATH" ]; then
2015-10-02 09:01:12 +00:00
curl -o go_latest.tar.gz ${GO_CUR}
2015-09-18 09:19:52 +00:00
tar -C /usr/local -xzf go_latest.tar.gz
rm go_latest.tar.gz
export PATH=$PATH:/usr/local/go/bin
mkdir /v2ray
export GOPATH=/v2ray
fi
go get -u github.com/v2ray/v2ray-core
2015-10-18 09:57:43 +00:00
rm $GOPATH/bin/build
go install github.com/v2ray/v2ray-core/tools/build
$GOPATH/bin/build