Skip to content

Commit

Permalink
fix more shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-solana committed Jun 23, 2018
1 parent 13773b5 commit 2a93bd0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions multinode-demo/myip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

function myip()
{
declare ipaddrs=(
$(curl -s ifconfig.co) # query interwebs
$(ifconfig | awk '/inet(6)? (addr:)?/ {print $2}') # machine interfaces
)
declare ipaddrs=( )

# query interwebs
mapfile -t ipaddrs < <(curl -s ifconfig.co)

# machine's interfaces
mapfile -t -O "${#ipaddrs[*]}" ipaddrs < \
<(ifconfig | awk '/inet(6)? (addr:)?/ {print $2}')

ipaddrs=( "${extips[@]}" "${ipaddrs[@]}" )

if (( ! ${#ipaddrs[*]} ))
then
Expand Down

0 comments on commit 2a93bd0

Please sign in to comment.