You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
705 B

  1. #!/bin/bash
  2. # Run this as tmuser user
  3. # This part is for installing go
  4. if [ `whoami` == "root" ];
  5. then
  6. echo "You should not run this script as root"
  7. exit 1
  8. fi
  9. USER=`whoami`
  10. PWD=`pwd`
  11. # get dependencies
  12. # sudo apt-get install -y make screen gcc git mercurial libc6-dev pkg-config libgmp-dev
  13. # install golang
  14. cd /home/$USER
  15. mkdir gocode
  16. wget https://storage.googleapis.com/golang/go1.4.2.src.tar.gz
  17. tar -xzvf go*.tar.gz
  18. cd go/src
  19. ./make.bash
  20. mkdir -p /home/$USER/go/src
  21. echo 'export GOROOT=/home/$USER/go' >> /home/$USER/.bashrc
  22. echo 'export GOPATH=/home/$USER/gocode' >> /home/$USER/.bashrc
  23. echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/$USER/.bashrc
  24. source /home/$USER/.bashrc
  25. cd $PWD