Browse Source

LND connect in REST and RPC mode

master
Christian Rotzoll 6 years ago
parent
commit
5b57f38d89
  1. 6
      home.admin/97addMobileWallet.sh
  2. 15
      home.admin/97addMobileWalletLNDconnect.sh

6
home.admin/97addMobileWallet.sh

@ -111,7 +111,7 @@ case $CHOICE in
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletLNDconnect.sh 10009
./97addMobileWalletLNDconnect.sh RPC
exit 1;
;;
ZEUS_IOS)
@ -130,7 +130,7 @@ case $CHOICE in
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletLNDconnect.sh 8080
./97addMobileWalletLNDconnect.sh REST
exit 1;
;;
ZEUS_ANDROID)
@ -147,7 +147,7 @@ case $CHOICE in
rm -f qr.txt
/home/admin/XXdisplayQRlcd_hide.sh
./97addMobileWalletLNDconnect.sh 8080
./97addMobileWalletLNDconnect.sh REST
exit 1;
;;
esac

15
home.admin/97addMobileWalletLNDconnect.sh

@ -3,7 +3,14 @@
# get service port from argument
servicePort="10009"
if [ $# -gt 0 ]; then
servicePort="$1"
if [ "$1" == "RPC" ]; then
echo "running RPC mode"
servicePort="10009"
fi
if [ "$1" == "REST" ]; then
echo "running REST mode"
servicePort="8080"
fi
fi
# load raspiblitz config data
@ -79,7 +86,11 @@ if [ ${#sshtunnel} -gt 0 ]; then
if [ ${isForwarded} -gt 0 ]; then
local=0
host=$(echo $sshtunnel | cut -d '@' -f2 | cut -d ' ' -f1)
port=$(echo $sshtunnel | awk "{split($0,a,\"${servicePort}<\"); print a[2]}" | cut -d ' ' -f1 | sed 's/[^0-9]//g')
if [ "${servicePort}" == "1009" ]; then
port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | cut -d ' ' -f1 | sed 's/[^0-9]//g')
elif [ "${servicePort}" == "8080" ]; then
port=$(echo $sshtunnel | awk '{split($0,a,"8080<"); print a[2]}' | cut -d ' ' -f1 | sed 's/[^0-9]//g')
fi
echo "port ${servicePort} forwarding from port ${port} from server ${host}"
else
echo "port ${servicePort} is not part of the ssh forwarding - keep default port ${servicePort}"

Loading…
Cancel
Save