2015-09-18 09:19:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-06-04 21:08:48 +00:00
|
|
|
GO_AMD64=https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
|
2017-06-06 08:40:19 +00:00
|
|
|
GO_X86=https://storage.googleapis.com/golang/go1.8.3.linux-386.tar.gz
|
2015-10-02 09:01:12 +00:00
|
|
|
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-12-25 02:11:13 +00:00
|
|
|
which git > /dev/null || apt-get install git -y
|
2015-09-18 09:19:52 +00:00
|
|
|
|
|
|
|
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
|
2015-12-25 02:11:13 +00:00
|
|
|
|
|
|
|
mkdir /v2ray &> /dev/null
|
2015-09-18 09:19:52 +00:00
|
|
|
export GOPATH=/v2ray
|
|
|
|
fi
|
|
|
|
|
2017-06-04 21:08:48 +00:00
|
|
|
go get -u v2ray.com/core/...
|
2017-06-07 10:08:01 +00:00
|
|
|
go get -u v2ray.com/ext/...
|
2017-06-04 21:08:48 +00:00
|
|
|
rm $GOPATH/bin/vbuild
|
|
|
|
go install v2ray.com/ext/tools/build/vbuild
|
|
|
|
$GOPATH/bin/vbuild
|