From 793f6d3ddd4bc58a77737cc771592934cd7cc043 Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Wed, 3 Apr 2019 14:55:39 +0100 Subject: [PATCH] fix getting forward port --- home.admin/97addMobileWalletShango.sh | 5 +++-- home.admin/97addMobileWalletZap.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/home.admin/97addMobileWalletShango.sh b/home.admin/97addMobileWalletShango.sh index 14bd940..bad539a 100644 --- a/home.admin/97addMobileWalletShango.sh +++ b/home.admin/97addMobileWalletShango.sh @@ -63,7 +63,7 @@ if [ ${#sshtunnel} -gt 0 ]; then isForwarded=$(echo ${sshtunnel} | grep -c "10009<") if [ ${isForwarded} -gt 0 ]; then host=$(echo $sshtunnel | cut -d '@' -f2 | cut -d ' ' -f1) - port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | sed 's/[^0-9]//g') + port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | cut -d ' ' -f1) echo "port 10009 forwarding from port ${port} from server ${host}" else echo "port 10009 is not part of the ssh forwarding - keep default port 10009" @@ -82,4 +82,5 @@ clear echo "Now press 'Connect' within the Shango Wallet." echo "If its not working - check issues on GitHub:" echo "https://github.com/neogeno/shango-lightning-wallet/issues" -echo "" \ No newline at end of file +echo "" + diff --git a/home.admin/97addMobileWalletZap.sh b/home.admin/97addMobileWalletZap.sh index 6d8bea2..a6a415b 100755 --- a/home.admin/97addMobileWalletZap.sh +++ b/home.admin/97addMobileWalletZap.sh @@ -95,7 +95,7 @@ if [ ${#sshtunnel} -gt 0 ]; then isForwarded=$(echo ${sshtunnel} | grep -c "10009<") if [ ${isForwarded} -gt 0 ]; then host=$(echo $sshtunnel | cut -d '@' -f2 | cut -d ' ' -f1) - port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | sed 's/[^0-9]//g') + port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | cut -d ' ' -f1) echo "port 10009 forwarding from port ${port} from server ${host}" else echo "port 10009 is not part of the ssh forwarding - keep default port 10009"