Skip to content
Bitcoin & Lightning full node on a Raspberry Pi
Shell
Branch: master
Clone or download
in3rsha and Stadicus Grep for "^port=" in bitcoin.conf (#491)
When checking to see what port bitcoind is using in bitcoin.conf, this script currently greps for the port number like so:

```
cat ${bitcoin_dir}/bitcoin.conf 2>/dev/null | grep port= | awk -F"=" '{print $2}'
```

However, this would mean that it would pick up the port number for the rpcport instead from bitcoin.conf (even if it was commented out), such as:

```
# Listen for RPC connections on this TCP port:
#rpcport=8332
```

As a result, this script would end up checking to see if the node is publicly available by doing `nc -z {ip} 8332`, even if the node was running on port 8333 like normal.

So all I've done is make a tiny edit to the grep to only look for lines that start with "port=" only, which avoids accidentally grabbing the wrong port number from lines like "rpcport=" or even "#port=".

```
cat ${bitcoin_dir}/bitcoin.conf 2>/dev/null | grep ^port= | awk -F"=" '{print $2}'
```
Latest commit ea3a6e8 Sep 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images 60_eps_pip_install.png (#484) Sep 3, 2019
raspibolt Exclude legacy catch page from navigation Apr 26, 2019
resources Grep for "^port=" in bitcoin.conf (#491) Sep 26, 2019
LICENSE Create LICENSE May 9, 2019
README.md New structure for GitHub Pages Apr 25, 2019
_config.yml Add link to GitHub sources Apr 25, 2019
index.md New structure for GitHub Pages Apr 25, 2019
raspibolt_10_preparations.md update Windows installation of bitcoind to 18.1 (#485) Sep 3, 2019
raspibolt_20_pi.md Update Raspbian from Stretch to Buster (#471) Aug 14, 2019
raspibolt_30_bitcoin.md Update for 0.18.1 (#481) Sep 3, 2019
raspibolt_40_lnd.md Update for LND 0.7.1-beta (#482) Sep 3, 2019
raspibolt_50_mainnet.md New structure for GitHub Pages Apr 25, 2019
raspibolt_60_bonus.md Added lntop to bonus section (#480) Aug 22, 2019
raspibolt_61_system-overview.md Fix absolute path links (#439) Apr 26, 2019
raspibolt_62_commandline.md New structure for GitHub Pages Apr 25, 2019
raspibolt_64_electrum.md Updates to Electrum Personal Server 0.1.7 (#483) Sep 3, 2019
raspibolt_65_system-recovery.md New structure for GitHub Pages Apr 25, 2019
raspibolt_66_remote_lncli.md New structure for GitHub Pages Apr 25, 2019
raspibolt_67_additional-scripts.md Fix absolute path links (#439) Apr 26, 2019
raspibolt_68_shango.md update shango qr code generation (#464) Jul 4, 2019
raspibolt_69_tor.md Update Raspbian from Stretch to Buster (#471) Aug 14, 2019
raspibolt_6A_auto-unlock.md New structure for GitHub Pages Apr 25, 2019
raspibolt_70_troubleshooting.md update Windows installation of bitcoind to 18.1 (#485) Sep 3, 2019
raspibolt_71_zap.md New structure for GitHub Pages Apr 25, 2019
raspibolt_72_zap-ios.md New structure for GitHub Pages Apr 25, 2019
raspibolt_72_zeus-over-tor.md Create raspibolt_72_zeus-over-tor.md (#454) Jun 13, 2019
raspibolt_73_static_backup_dropox.md fix navigation Jul 10, 2019
raspibolt_74_lntop.md Added lntop to bonus section (#480) Aug 22, 2019
raspibolt_faq.md keep lnd and bitcoin last version link in the main section (#446) May 19, 2019

README.md

You can’t perform that action at this time.