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.

22 lines
608 B

  1. #!/bin/bash
  2. # Run this as tmuser user
  3. # This part is for installing go
  4. if [ `whoami` != "root" ];
  5. then
  6. cd /home/tmuser
  7. mkdir gocode
  8. wget https://storage.googleapis.com/golang/go1.4.2.src.tar.gz
  9. tar -xzvf go*.tar.gz
  10. cd go/src
  11. ./make.bash
  12. cd /home/tmuser
  13. cp /etc/skel/.bashrc .
  14. mkdir -p /home/tmuser/go/src
  15. echo 'export GOROOT=/home/tmuser/go' >> /home/tmuser/.bashrc
  16. echo 'export GOPATH=/home/tmuser/gocode' >> /home/tmuser/.bashrc
  17. echo 'export PATH=$PATH:$GOROOT/bin' >> /home/tmuser/.bashrc
  18. source /home/tmuser/.bashrc
  19. else
  20. echo "should not be root to run install_golang.sh"
  21. fi