LND connect in REST and RPC mode

This commit is contained in:
Christian Rotzoll
2019-04-04 03:32:44 +01:00
parent abf25073bc
commit 5b57f38d89
2 changed files with 16 additions and 5 deletions

View File

@@ -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

View File

@@ -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}"