Last active
November 20, 2017 13:22
-
-
Save andrewkroh/567485523fd3e3d1eab1 to your computer and use it in GitHub Desktop.
Install Golang 1.5.1 on Solaris
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
function setup_profile() { | |
profile=$1 | |
cat << 'EOF' >> $profile | |
export GOROOT=/go1.5.1-solaris | |
export GOPATH=$HOME/go | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH | |
[ ! -d "$GOPATH" ] && mkdir $GOPATH | |
EOF | |
} | |
cd / | |
# Wait for network | |
echo Waiting for network to be available... | |
while [ 1 ]; do curl --silent http://google.com > /dev/null && break; sleep 1; done | |
echo Installing golang 1.5.1 | |
if [ ! -e "go1.5.1-solaris" ]; then | |
curl --silent -O http://deploy.andrewkroh.com/golang/go1.5.1-solaris.tar.gz | |
echo '85242794013dc76dda6de6198029d9a3dd97ed4d go1.5.1-solaris.tar.gz' | sha1sum -c | |
tar xzf go1.5.1-solaris.tar.gz | |
fi | |
echo Configuring golang environment for vagrant and root | |
setup_profile /root/.profile | |
setup_profile /export/home/vagrant/.profile | |
echo Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
download link returns "Access denied"