go: fix GOPATH settings

This commit is contained in:
openoms
2019-12-17 13:44:10 +00:00
parent f18b7c6fe1
commit f552c04878
5 changed files with 18 additions and 5 deletions

View File

@@ -23,6 +23,9 @@ source /mnt/hdd/raspiblitz.conf
# make sure lndconnect is installed # make sure lndconnect is installed
/home/admin/config.scripts/bonus.lndconnect.sh /home/admin/config.scripts/bonus.lndconnect.sh
# get Go vars
source /etc/profile
# default host to local IP and port # default host to local IP and port
local=1 local=1
localIP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') localIP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')

View File

@@ -18,6 +18,9 @@ fi
# make sure lndconnect is installed # make sure lndconnect is installed
/home/admin/config.scripts/bonus.lndconnect.sh /home/admin/config.scripts/bonus.lndconnect.sh
# get Go vars
source /etc/profile
if [ $1 == zeus ]; then if [ $1 == zeus ]; then
echo "" echo ""
echo "Set up on your mobile: " echo "Set up on your mobile: "

View File

@@ -48,6 +48,9 @@ if [ ${goInstalled} -eq 0 ];then
sudo bash -c "echo 'GOPATH=/usr/local/gocode' >> /etc/profile" sudo bash -c "echo 'GOPATH=/usr/local/gocode' >> /etc/profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/bin/' >> /etc/profile" sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/bin/' >> /etc/profile"
# set GOPATH https://github.com/golang/go/wiki/SettingGOPATH
go env -w GOPATH=/usr/local/gocode
goInstalled=$(go version 2>/dev/null | grep -c 'go') goInstalled=$(go version 2>/dev/null | grep -c 'go')
fi fi
if [ ${goInstalled} -eq 0 ];then if [ ${goInstalled} -eq 0 ];then

View File

@@ -7,12 +7,13 @@ commit=82d7103bb8c8dd3c8ae8de89e3bc061eef82bb8f
isInstalled=$(lndconnect -h | grep "nocert" -c) isInstalled=$(lndconnect -h | grep "nocert" -c)
if [ $isInstalled -eq 0 ]; then if [ $isInstalled -eq 0 ]; then
echo "Installing lndconnect.." echo "Installing lndconnect.."
# get Go vars
source /etc/profile
# Install latest lndconnect from source: # Install latest lndconnect from source:
go get -d github.com/LN-Zap/lndconnect go get -d github.com/LN-Zap/lndconnect
# locate lndconnect download dir cd $GOPATH/src/github.com/LN-Zap/lndconnect
cd /usr/local/gocode/src/github.com/LN-Zap/lndconnect
git checkout $commit git checkout $commit
make make
else else
echo "lndconnect is already installed" echo "lndconnect is already installed"
fi fi

View File

@@ -22,8 +22,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
isInstalled=$(sudo ls /etc/systemd/system/loopd.service 2>/dev/null | grep -c 'loopd.service') isInstalled=$(sudo ls /etc/systemd/system/loopd.service 2>/dev/null | grep -c 'loopd.service')
if [ ${isInstalled} -eq 0 ]; then if [ ${isInstalled} -eq 0 ]; then
/home/admin/config.scripts/go.install.sh /home/admin/config.scripts/bonus.go.sh
# get Go vars
source /etc/profile
cd /home/bitcoin cd /home/bitcoin
sudo -u bitcoin git clone https://github.com/lightninglabs/loop.git sudo -u bitcoin git clone https://github.com/lightninglabs/loop.git
cd /home/bitcoin/loop cd /home/bitcoin/loop
@@ -32,7 +35,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
go install ./... go install ./...
# make systemd service # make systemd service
# sudo nano /etc/systemd/system/electrs.service # sudo nano /etc/systemd/system/loopd.service
echo " echo "
[Unit] [Unit]
Description=Loopd Service Description=Loopd Service