make sctipts using blitz.lcd.sh

This commit is contained in:
rootzoll 2020-01-24 17:31:59 +01:00
parent ddeda71cc5
commit aed6d62821
3 changed files with 88 additions and 95 deletions

View File

@ -63,7 +63,7 @@ fi
CHOICE=$(whiptail --clear --title "Choose Mobile Wallet" --menu "" 13 50 7 "${OPTIONS[@]}" 2>&1 >/dev/tty)
./XXdisplayQRlcd_hide.sh
/home/admin/config.scripts/blitz.lcd.sh hide
clear
echo "creating install info ..."
@ -72,114 +72,81 @@ case $CHOICE in
exit 1;
;;
SHANGO_IOS)
echo "https://testflight.apple.com/join/WwCjFnS8" > qr.txt
./XXdisplayLCD.sh /home/admin/assets/install_shango.jpg
/home/admin/config.scripts/blitz.lcd.sh qr "https://testflight.apple.com/join/WwCjFnS8"
whiptail --title "Install Testflight and Shango 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/WwCjFnS8\n\nJoin testing and follow ALL instructions.\n\nWhen installed and started -> continue" 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
/home/admin/config.scripts/blitz.lcd.sh qr-console "https://testflight.apple.com/join/WwCjFnS8"
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletShango.sh
/home/admin/config.scripts/blitz.lcd.sh hide
./97addMobileWalletShango.sh
exit 1;
;;
SHANGO_ANDROID)
echo "market://details?id=com.shango" > qr.txt
./XXdisplayQRlcd.sh
/home/admin/config.scripts/blitz.lcd.sh qr "https://play.google.com/store/apps/details?id=com.shango"
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\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue" 10 60
--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\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue" 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
/home/admin/config.scripts/blitz.lcd.sh qr-console "https://play.google.com/store/apps/details?id=com.shango"
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletShango.sh
exit 1;
;;
/home/admin/config.scripts/blitz.lcd.sh hide
./97addMobileWalletShango.sh
exit 1;
;;
ZAP_IOS)
echo "https://testflight.apple.com/join/P32C380R" > qr.txt
./XXdisplayQRlcd.sh
/home/admin/config.scripts/blitz.lcd.sh qr "https://testflight.apple.com/join/P32C380R"
whiptail --title "Install Testflight and Zap on your iOS device" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Search for 'Zap Bitcoin' in Apple Appstore for basc version\nOr join public beta test for latest features:\nhttps://testflight.apple.com/join/P32C380R\n\nJoin testing and follow ALL instructions.\n\nWhen installed and started -> continue" 11 60
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Search for 'Zap Bitcoin' in Apple Appstore for basc version\nOr join public beta test for latest features:\nhttps://testflight.apple.com/join/P32C380R\n\nJoin testing and follow ALL instructions.\n\nWhen installed and started -> continue" 11 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
/home/admin/config.scripts/blitz.lcd.sh qr-console "https://testflight.apple.com/join/P32C380R"
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
/home/admin/config.scripts/bonus.lndconnect.sh RPC
exit 1;
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/bonus.lndconnect.sh RPC
exit 1;
;;
ZAP_ANDROID)
echo "https://play.google.com/store/apps/details?id=zapsolutions.zap" > qr.txt
./XXdisplayQRlcd.sh
/home/admin/config.scripts/blitz.lcd.sh qr "https://play.google.com/store/apps/details?id=zapsolutions.zap"
whiptail --title "Install Zap from PlayStore on your Android device" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Find & install the Zap Wallet on the Android Play Store:\n\nhttps://play.google.com/store/apps/details?id=zapsolutions.zap\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue." 10 60
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Find & install the Zap Wallet on the Android Play Store:\n\nhttps://play.google.com/store/apps/details?id=zapsolutions.zap\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue." 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
/home/admin/config.scripts/blitz.lcd.sh qr-console "https://play.google.com/store/apps/details?id=zapsolutions.zap"
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
/home/admin/config.scripts/bonus.lndconnect.sh RPC
exit 1;
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/bonus.lndconnect.sh RPC
exit 1;
;;
ZEUS_IOS)
echo "https://testflight.apple.com/join/gpVFzEHN" > qr.txt
./XXdisplayQRlcd.sh
/home/admin/config.scripts/blitz.lcd.sh qr "https://testflight.apple.com/join/gpVFzEHN"
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.\n\nWhen installed and started -> continue" 10 60
--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.\n\nWhen installed and started -> continue" 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
/home/admin/config.scripts/blitz.lcd.sh qr-console "https://testflight.apple.com/join/gpVFzEHN"
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
/home/admin/config.scripts/bonus.lndconnect.sh REST
exit 1;
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/bonus.lndconnect.sh REST
exit 1;
;;
ZEUS_ANDROID)
echo "market://details?id=com.zeusln.zeus" > qr.txt
./XXdisplayQRlcd.sh
/home/admin/config.scripts/blitz.lcd.sh qr "https://play.google.com/store/apps/details?id=com.zeusln.zeus"
whiptail --title "Install Shango on your Android Phone" \
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Find and install 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.\n\nWhen installed and started -> continue." 10 60
--yes-button "continue" \
--no-button "link as QR code" \
--yesno "Find and install 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.\n\nWhen installed and started -> continue." 10 60
if [ $? -eq 1 ]; then
/home/admin/XXdisplayQR.sh
/home/admin/config.scripts/blitz.lcd.sh qr-console "https://play.google.com/store/apps/details?id=com.zeusln.zeus"
fi
shred qr.txt
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
/home/admin/config.scripts/bonus.lndconnect.sh REST
exit 1;
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/bonus.lndconnect.sh REST
exit 1;
;;
esac
esac

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

View File

@ -4,7 +4,7 @@
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# config script to connect mobile apps with lnd connect"
echo "# will autodetect dyndns, sshtunnel or TOR"
echo "# bonus.lndconnect.sh [REST|RPC] [?NOCERT]"
echo "# bonus.lndconnect.sh [REST|RPC] [?NOCERT|SHANGO]"
exit 1
fi
@ -15,10 +15,12 @@ source /mnt/hdd/raspiblitz.conf
#### PARAMETER
# defaults
connector="lndconnect"
servicePort="10009"
useTOR=0
extraparamter=""
# 1. REST or RPC
# determine service port from argument
if [ "$1" == "RPC" ]; then
@ -34,6 +36,9 @@ fi
if [ "$2" == "NOCERT" ]; then
echo "# forcing NOCERT"
extraparamter="--nocert"
elif [ "$2" == "SHANGO" ]; then
echo "# connecting thru shango QR code"
connector="shango"
fi
#### MAKE SURE LNDCONNECT IS INSTALLED
@ -105,14 +110,33 @@ fi
#### RUN LNDCONNECT
# get Go vars
source /etc/profile
imagePath=""
datastring=""
# write qr code data to an image
lndconnect --host=${host} --port=${port} --image ${extraparamter}
if [ "${connector}" == "lndconnect" ]; then
# display qr code image on LCD
./XXdisplayLCD.sh lndconnect-qr.png
# get Go vars
source /etc/profile
# write qr code data to an image
lndconnect --host=${host} --port=${port} --image ${extraparamter}
imagePath=$(readlink -f lndconnect-qr.png)
# display qr code image on LCD
/home/admin/config.scripts/blitz.lcd.sh image ${imagePath}
elif [ "${connector}" == "shango" ]; then
# write qr code data to text file
datastring=$(echo -e "${host}:${port},\n$(xxd -p -c2000 /home/admin/.lnd/data/chain/${network}/${chain}net/admin.macaroon),\n$(openssl x509 -sha256 -fingerprint -in /home/admin/.lnd/tls.cert -noout)")
# display qr code on LCD
/home/admin/config.scripts/blitz.lcd.sh qr ${datastring}
else
echo "error='unkown connector'"
exit 1
fi
# show pairing info dialog
msg=""
@ -126,17 +150,19 @@ whiptail --backtitle "Connecting Mobile Wallet" \
--no-button "show QR code" \
--yesno "${msg}" 18 65
if [ $? -eq 1 ]; then
lndconnect --host=${host} --port=${port} ${extraparamter}
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished."
read key
if [ "${connector}" == "lndconnect" ]; then
lndconnect --host=${host} --port=${port} ${extraparamter}
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished."
read key
elif [ "${connector}" == "shango" ]; then
/home/admin/config.scripts/blitz.lcd.sh qr-console ${datastring}
fi
fi
# clean up
./XXdisplayQRlcd_hide.sh
shred lndconnect-qr.png 2> /dev/null
rm -f lndconnect-qr.png 2> /dev/null
shred qr.txt 2> /dev/null
rm -f qr.txt 2> /dev/null
/home/admin/config.scripts/blitz.lcd.sh hide
shred ${imagePath} 2> /dev/null
rm -f ${imagePath} 2> /dev/null
echo "------------------------------"
echo "If the connection was not working:"