Skip to content

Commit

Permalink
Added adaptable network device name (#283)
Browse files Browse the repository at this point in the history
* Added adaptable network device name

updated script to use a user-defined variable for network device name to make it easier for users to adapt the script to wireless or Debian-standard 'predictable network names.'

* Update 20-raspibolt-welcome
  • Loading branch information
oitdmser authored and Stadicus committed Nov 21, 2018
1 parent 22ed999 commit f5e8f11
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions raspibolt/resources/20-raspibolt-welcome
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ color_gray='\033[0;37m'
bitcoin_dir="/home/bitcoin/.bitcoin"
lnd_dir="/home/bitcoin/.lnd"

#set external HDD. Set to mount point of blockchain volume
#Set to mount point of blockchain volume. This is used to calculate USB HDD usage %
ext_hdd="/mnt/hdd"

#Set to network device name (usually eth0 for ethernet or wlan0 for wireless on raspberry pi unless you have 'Predictable Network Names' turned on in raspi-config. To get network device name run ifconfig.)
network_name="eth0"

# get uptime & load
load=$(w | grep "load average:" | cut -c11-)

Expand Down Expand Up @@ -54,8 +57,8 @@ else
fi

# get network traffic
network_rx=$(ifconfig eth0 | grep 'RX packets' | awk '{ print $6$7 }' | sed 's/[()]//g')
network_tx=$(ifconfig eth0 | grep 'TX packets' | awk '{ print $6$7 }' | sed 's/[()]//g')
network_rx=$(ifconfig ${network_name} | grep 'RX packets' | awk '{ print $6$7 }' | sed 's/[()]//g')
network_tx=$(ifconfig ${network_name} | grep 'TX packets' | awk '{ print $6$7 }' | sed 's/[()]//g')

# Bitcoin blockchain
btc_path=$(command -v bitcoin-cli)
Expand Down

0 comments on commit f5e8f11

Please sign in to comment.