raspiblitz/home.admin/97addMobileWalletZap.sh

102 lines
2.8 KiB
Bash
Raw Normal View History

2018-08-31 19:22:41 +02:00
#!/bin/bash
2018-12-21 01:59:26 +01:00
# load raspiblitz config data
2019-02-02 23:49:04 +01:00
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
2018-08-31 19:22:41 +02:00
2019-01-17 22:40:26 +01:00
# export go vars (if needed)
if [ ${#GOROOT} -eq 0 ]; then
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
fi
if [ ${#GOPATH} -eq 0 ]; then
export GOPATH=/usr/local/gocode
export PATH=$PATH:$GOPATH/bin
fi
2019-01-17 18:26:57 +01:00
2019-01-17 22:58:15 +01:00
# make sure go is installed
goInstalled=$(go version 2>/dev/null | grep -c 'go')
if [ ${goInstalled} -eq 0 ];then
2019-01-17 18:24:14 +01:00
echo "### Installing GO ###"
wget https://storage.googleapis.com/golang/go1.11.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.11.linux-armv6l.tar.gz
sudo rm *.gz
sudo mkdir /usr/local/gocode
sudo chmod 777 /usr/local/gocode
2019-01-17 22:58:15 +01:00
goInstalled=$(go version 2>/dev/null | grep -c 'go')
2019-01-17 18:24:14 +01:00
fi
2019-01-17 22:58:15 +01:00
if [ ${goInstalled} -eq 0 ];then
2019-01-31 21:10:01 +01:00
echo "FAIL: Was not able to install GO (needed to run LndConnect)"
2019-01-17 18:24:14 +01:00
exit 1
fi
2018-08-31 19:22:41 +02:00
# make sure qrcode-encoder in installed
clear
echo "*** Setup ***"
echo ""
echo "Installing lndconnect. Please wait..."
2018-08-31 19:22:41 +02:00
echo ""
2019-01-31 21:10:01 +01:00
echo "Getting github.com/LN-Zap/lndconnect (please wait) ..."
go get -d github.com/LN-Zap/lndconnect
cd $GOPATH/src/github.com/LN-Zap/lndconnect
2018-08-31 19:22:41 +02:00
echo ""
2019-01-31 21:10:01 +01:00
echo "Building github.com/LN-Zap/lndconnect ..."
2018-12-21 03:03:06 +01:00
make
cd
sleep 3
2018-08-31 19:22:41 +02:00
clear
echo "******************************"
echo "Connect Zap Mobile Wallet"
echo "******************************"
echo ""
echo "GETTING THE APP"
echo "At the moment this app is in closed beta testing."
2018-08-31 19:22:41 +02:00
echo "Go to http://www.zap-ios.jackmallers.com sign up with your email (confirmation can take time)"
echo "iOS: Read https://developer.apple.com/testflight/testers/"
echo ""
echo "*** STEP 1 ***"
if [ ${#dynDomain} -eq 0 ]; then
2018-12-21 02:48:25 +01:00
echo "Once you have the app is running make sure you are on the same local network (WLAN same as LAN)."
fi
echo "During Setup of the Zap app you should get to the 'Connect Remote-Node' screen."
2018-08-31 19:22:41 +02:00
echo ""
2018-12-21 02:48:25 +01:00
echo "---> Click on Scan"
2018-08-31 19:22:41 +02:00
echo "Make the this terminal as big as possible - fullscreen would be best."
echo "Then PRESS ENTER here in the terminal to generare the QR code and scan it with the app."
read key
clear
echo "*** STEP 2 : Click on Scan (make whole QR code fill camera) ***"
if [ ${#dynDomain} -eq 0 ]; then
# If you drop the -i parameter, lndconnect will use the external IP.
2019-01-31 21:17:55 +01:00
lndconnect -i
2018-12-21 01:59:26 +01:00
else
# when dynamic domain is set
2019-01-31 21:17:55 +01:00
lndconnect --host=${dynDomain}
2018-12-21 01:59:26 +01:00
fi
2018-08-31 19:22:41 +02:00
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='Darwin' # mac OSX
fi
if [[ $platform == 'Linux' ]]; then
echo "(To shrink QR code: CTRL-) Press ENTER when finished."
elif [[ $platform == 'Darwin' ]]; then
echo "(To shrink QR code: CMD-) Press ENTER when finished."
fi
2018-08-31 19:22:41 +02:00
read key
clear
echo "If it's not working - check issues on GitHub:"
2018-08-31 19:22:41 +02:00
echo "https://github.com/LN-Zap/zap-iOS/issues"
2019-01-31 21:10:01 +01:00
echo "https://github.com/LN-Zap/lndconnect/issues"
2018-08-31 19:22:41 +02:00
echo ""