Created
March 25, 2017 17:21
-
-
Save zenith6/06f9e6262a9d4e04b869265e585234fb to your computer and use it in GitHub Desktop.
detect primary global ip address on CentOS 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ip -o -4 addr | awk '/scope global/ { print substr($4, 0, index($4, "/") - 1) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment