Handle manual installations of go

This commit is contained in:
Bob Mottram 2015-09-30 15:06:02 +01:00
parent a7409d0cdc
commit 6af67d0c7e
1 changed files with 9 additions and 1 deletions

View File

@ -22,7 +22,15 @@ ZERONET_DEFAULT_FORUM_TAGLINE="A decentralized discussion group"
function install_ipfs {
if [ ! -f /home/$MY_USERNAME/go/bin/ipfs ]; then
sudo apt-get -y install golang libpam0g-dev fuse
if [ ! -d /usr/local/go ]; then
sudo apt-get -y install golang
fi
sudo apt-get -y install libpam0g-dev fuse
if ! grep -q "GOROOT" /home/$MY_USERNAME/.bashrc; then
if [ -d /usr/local/go ]; then
echo "export GOROOT=/usr/local/go" >> /home/$MY_USERNAME/.bashrc
fi
fi
if ! grep -q "GOPATH/bin" /home/$MY_USERNAME/.bashrc; then
echo "export GOPATH=/home/$MY_USERNAME/go" >> /home/$MY_USERNAME/.bashrc
echo 'export PATH="$GOPATH/bin:$PATH:";' >> /home/$MY_USERNAME/.bashrc