Browse Source

refactor Zap and Zeus integration

master
Christian Rotzoll 6 years ago
parent
commit
abf25073bc
  1. 62
      home.admin/97addMobileWallet.sh
  2. 24
      home.admin/97addMobileWalletLNDconnect.sh

62
home.admin/97addMobileWallet.sh

@ -43,9 +43,10 @@ fi
# Basic Options
OPTIONS=(ZAP "Zap Wallet (iOS)" \
ZEUS "Zeus Wallet (iOS/Android)"
SHANGO_IOS "Shango Wallet for iOS"
SHANGO_ANDROID "Shango Wallet for Android"
SHANGO_IOS "Shango Wallet (iOS)" \
SHANGO_ANDROID "Shango Wallet (Android)" \
ZEUS_IOS "Zeus Wallet (iOS)" \
ZEUS_ANDROID "Zeus Wallet (Android)"
)
CHOICE=$(whiptail --clear --title "Choose Mobile Wallet" --menu "" 15 50 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
@ -82,7 +83,7 @@ case $CHOICE in
whiptail --title "Install Shango on your Android Phone" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "At the moment this app is in public beta testing:\n\nhttps://play.google.com/apps/testing/com.shango" 10 60
--yesno "At the moment this app is in public beta testing:\n\nhttps://play.google.com/apps/testing/com.shango\n\nEasiest way to install scan QR code on LCD with phone." 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
@ -95,11 +96,58 @@ case $CHOICE in
exit 1;
;;
ZAP)
./97addMobileWalletZap.sh
echo "https://testflight.apple.com/join/P32C380R" > qr.txt
./XXdisplayQRlcd.sh
whiptail --title "Install Testflight and Zap on your iOS device" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "At the moment this app is in public beta testing:\n\nhttps://testflight.apple.com/join/P32C380R\n\nJoin testing and follow all instructions." 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletLNDconnect.sh 10009
exit 1;
;;
ZEUS)
./97addMobileWalletZeus.sh
ZEUS_IOS)
echo "https://testflight.apple.com/join/gpVFzEHN" > qr.txt
./XXdisplayQRlcd.sh
whiptail --title "Install Testflight and Zeus on your iOS device" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "At the moment this app is in public beta testing:\n\nhttps://testflight.apple.com/join/gpVFzEHN\n\nJoin testing and follow all instructions." 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletLNDconnect.sh 8080
exit 1;
;;
ZEUS_ANDROID)
echo "market://details?id=com.zeusln.zeus" > qr.txt
./XXdisplayQRlcd.sh
whiptail --title "Install Shango on your Android Phone" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Find the Zeus Wallet on the Android Play Store:\n\nhttps://play.google.com/store/apps/details?id=com.zeusln.zeus\n\nEasiest way to install scan QR code on LCD with phone." 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletLNDconnect.sh 8080
exit 1;
;;
esac

24
home.admin/97addMobileWalletZap.sh → home.admin/97addMobileWalletLNDconnect.sh

@ -1,5 +1,11 @@
#!/bin/bash
# get service port from argument
servicePort="10009"
if [ $# -gt 0 ]; then
servicePort="$1"
fi
# load raspiblitz config data
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
@ -55,32 +61,31 @@ make
cd
sleep 3
# default host to local IP and port 10009
# default host to local IP and port
local=1
host=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
port="10009"
port="${servicePort}"
# change host to dynDNS if set
if [ ${#dynDomain} -gt 0 ]; then
local=0
host="${dynDomain}"
echo "port 10009 forwarding from dynDomain ${host}"
echo "port ${servicePort} forwarding from dynDomain ${host}"
fi
# check if port 10009 is forwarded
# check if local service port is forwarded
if [ ${#sshtunnel} -gt 0 ]; then
isForwarded=$(echo ${sshtunnel} | grep -c "10009<")
isForwarded=$(echo ${sshtunnel} | grep -c "${servicePort}<")
if [ ${isForwarded} -gt 0 ]; then
local=0
host=$(echo $sshtunnel | cut -d '@' -f2 | cut -d ' ' -f1)
port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | cut -d ' ' -f1 | sed 's/[^0-9]//g')
echo "port 10009 forwarding from port ${port} from server ${host}"
port=$(echo $sshtunnel | awk "{split($0,a,\"${servicePort}<\"); print a[2]}" | cut -d ' ' -f1 | sed 's/[^0-9]//g')
echo "port ${servicePort} forwarding from port ${port} from server ${host}"
else
echo "port 10009 is not part of the ssh forwarding - keep default port 10009"
echo "port ${servicePort} is not part of the ssh forwarding - keep default port ${servicePort}"
fi
fi
clear
echo "******************************"
echo "Connect Zap Mobile Wallet"
echo "******************************"
@ -110,6 +115,5 @@ read key
clear
echo "If it's not working - check issues on GitHub:"
echo "https://github.com/LN-Zap/zap-iOS/issues"
echo "https://github.com/LN-Zap/lndconnect/issues"
echo ""
Loading…
Cancel
Save