Skip to content

Instantly share code, notes, and snippets.

@andrewkroh
Last active November 20, 2017 13:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewkroh/567485523fd3e3d1eab1 to your computer and use it in GitHub Desktop.
Save andrewkroh/567485523fd3e3d1eab1 to your computer and use it in GitHub Desktop.
Install Golang 1.5.1 on Solaris
#!/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
@mikekoetter
Copy link

download link returns "Access denied"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment