Skip to content

Commit

Permalink
fixed ip address bug
Browse files Browse the repository at this point in the history
  • Loading branch information
osmode committed Nov 25, 2017
1 parent 47eedc5 commit 6f1d7c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions log_nodeInfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ output="$(ifconfig)"
#fi

#echo "$output" | grep -oE '(((inet addr:)1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5]) ' >> $PWD/ddash/nodeInfo.ds
result=$(echo "$output" | (grep -oE "\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b" | head -1))

result=$(echo "$output" | grep -oE '(((inet addr:)1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5][^\s]) ')
echo your ip address is: ${result:10}
echo "${result:10}" >> $PWD/ddash/nodeInfo.ds
echo your ip address is: ${result}
echo "${result}" >> $PWD/ddash/nodeInfo.ds

0 comments on commit 6f1d7c7

Please sign in to comment.