mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-20 02:09:15 +01:00
get bitcoind public ip from cli
This commit is contained in:
parent
4cafadbc1c
commit
7e02934f6d
@ -111,22 +111,7 @@ fi
|
|||||||
# get IP address & port
|
# get IP address & port
|
||||||
local_ip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
local_ip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
||||||
public_ip=$(curl -s http://v4.ipv6-test.com/api/myip.php)
|
public_ip=$(curl -s http://v4.ipv6-test.com/api/myip.php)
|
||||||
public_port=$(cat ${bitcoin_dir}/${network}.conf 2>/dev/null | grep port= | awk -F"=" '{print $2}')
|
public_port="$(${network}-cli -datadir=${bitcoin_dir} getnetworkinfo | jq -r '.localaddresses [0] .port')"
|
||||||
if [ "${public_port}" = "" ]; then
|
|
||||||
if [ "${network}" = "litecoin" ]; then
|
|
||||||
if [ "${chain}" = "test" ]; then
|
|
||||||
public_port=19333
|
|
||||||
else
|
|
||||||
public_port=9333
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ "${chain}" = "test" ]; then
|
|
||||||
public_port=18333
|
|
||||||
else
|
|
||||||
public_port=8333
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# CHAIN NETWORK
|
# CHAIN NETWORK
|
||||||
public_addr="??"
|
public_addr="??"
|
||||||
@ -221,4 +206,4 @@ ${color_yellow}${ln_external}
|
|||||||
if [ ${#onionAddress} -eq 0 ]; then
|
if [ ${#onionAddress} -eq 0 ]; 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
|
||||||
|
Loading…
Reference in New Issue
Block a user