From e653e4158856be72e95228ff804e8372bf598f18 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 13:15:01 +0100 Subject: [PATCH] #295 fix TOR detection and line breaks --- home.admin/00infoBlitz.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 1be974cb1..21d464d77 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -152,16 +152,19 @@ torInfo="" networkVersion=$(${network}-cli -datadir=${bitcoin_dir} -version 2>/dev/null | cut -d ' ' -f6) # TOR or IP networkInfo=$(${network}-cli -datadir=${bitcoin_dir} getnetworkinfo) -onionAddress=$(echo ${networkInfo} | jq -r '.localaddresses [0] .address') networkConnections=$(echo ${networkInfo} | jq -r '.connections') networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}connections" -if [ "${onionAddress}" != "null" ]; then + +if [ "${runBehindTor}" = "on" ]; then + # TOR address + onionAddress=$(echo ${networkInfo} | jq -r '.localaddresses [0] .address') networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}peers" public_addr="${onionAddress}:${public_port}" public="" public_color="${color_green}" torInfo="+ TOR" + else # IP address @@ -286,7 +289,7 @@ ${color_yellow}${ln_publicColor}${ln_external} "-------------------------------------------" \ "load average:${load##up*, }" "${temp}" \ "${hdd}" "${sync_percentage}" -if [ ${#onionAddress} -eq 0 ]; then +if [ "${runBehindTor}" != "on" ]; then # one extra space line at the end if nodeaddress is not TOR echo "" fi