mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-11-19 10:28:58 +01:00
#295 fix TOR detection and line breaks
This commit is contained in:
@@ -152,16 +152,19 @@ torInfo=""
|
|||||||
networkVersion=$(${network}-cli -datadir=${bitcoin_dir} -version 2>/dev/null | cut -d ' ' -f6)
|
networkVersion=$(${network}-cli -datadir=${bitcoin_dir} -version 2>/dev/null | cut -d ' ' -f6)
|
||||||
# TOR or IP
|
# TOR or IP
|
||||||
networkInfo=$(${network}-cli -datadir=${bitcoin_dir} getnetworkinfo)
|
networkInfo=$(${network}-cli -datadir=${bitcoin_dir} getnetworkinfo)
|
||||||
onionAddress=$(echo ${networkInfo} | jq -r '.localaddresses [0] .address')
|
|
||||||
networkConnections=$(echo ${networkInfo} | jq -r '.connections')
|
networkConnections=$(echo ${networkInfo} | jq -r '.connections')
|
||||||
networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}connections"
|
networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}connections"
|
||||||
if [ "${onionAddress}" != "null" ]; then
|
|
||||||
|
if [ "${runBehindTor}" = "on" ]; then
|
||||||
|
|
||||||
# TOR address
|
# TOR address
|
||||||
|
onionAddress=$(echo ${networkInfo} | jq -r '.localaddresses [0] .address')
|
||||||
networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}peers"
|
networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}peers"
|
||||||
public_addr="${onionAddress}:${public_port}"
|
public_addr="${onionAddress}:${public_port}"
|
||||||
public=""
|
public=""
|
||||||
public_color="${color_green}"
|
public_color="${color_green}"
|
||||||
torInfo="+ TOR"
|
torInfo="+ TOR"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# IP address
|
# IP address
|
||||||
@@ -286,7 +289,7 @@ ${color_yellow}${ln_publicColor}${ln_external}
|
|||||||
"-------------------------------------------" \
|
"-------------------------------------------" \
|
||||||
"load average:${load##up*, }" "${temp}" \
|
"load average:${load##up*, }" "${temp}" \
|
||||||
"${hdd}" "${sync_percentage}"
|
"${hdd}" "${sync_percentage}"
|
||||||
if [ ${#onionAddress} -eq 0 ]; then
|
if [ "${runBehindTor}" != "on" ]; then
|
||||||
# one extra space line at the end if nodeaddress is not TOR
|
# one extra space line at the end if nodeaddress is not TOR
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user