raspiblitz/home.admin/97addMobileWalletZap.sh

87 lines
2.5 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
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 18:24:14 +01:00
# precheck if go is installed
result=$(command -v go >/dev/null 2>/dev/null)
if [ ${#result} -eq 0 ];then
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
result=$(command -v go >/dev/null 2>/dev/null)
fi
if [ ${#result} -eq 0 ];then
echo "FAIL: Was not able to install GO (needed to run ZapConnect)"
exit 1
fi
2018-08-31 19:22:41 +02:00
# make sure qrcode-encoder in installed
clear
echo "*** Setup ***"
echo ""
echo "Installing zapconnect. Please wait..."
echo ""
2018-12-21 03:03:06 +01:00
echo "Getting github.com/LN-Zap/zapconnect (please wait) ..."
2018-08-31 19:22:41 +02:00
go get -d github.com/LN-Zap/zapconnect
2019-01-17 18:24:14 +01:00
cd $GOPATH/src/github.com/LN-Zap/zapconnect
2018-08-31 19:22:41 +02:00
echo ""
echo "Building github.com/LN-Zap/zapconnect ..."
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 and the source code has not been published yet."
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 ***"
2018-12-21 02:48:25 +01:00
if [ ${#dynDomain} -eq 0 ]; then
echo "Once you have the app is running make sure you are on the same local network (WLAN same as LAN)."
fi
2018-12-21 02:49:03 +01:00
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) ***"
2018-12-21 02:36:24 +01:00
if [ ${#dynDomain} -eq 0 ]; then
2018-12-21 01:59:26 +01:00
# If you drop the -i parameter, zapconnect will use the external IP.
2018-12-21 03:03:06 +01:00
zapconnect -i
2018-12-21 01:59:26 +01:00
else
# when dynamic domain is set
2018-12-21 03:03:06 +01:00
zapconnect --host=${dynDomain}
2018-12-21 01:59:26 +01:00
fi
2018-08-31 19:22:41 +02:00
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished."
read key
clear
echo "If its not working - check issues on GitHub:"
echo "https://github.com/LN-Zap/zap-iOS/issues"
echo "https://github.com/LN-Zap/zapconnect/issues"
echo ""