Created
April 3, 2017 08:41
-
-
Save linben/1bb269741afcabe10a48bc53b4882cc7 to your computer and use it in GitHub Desktop.
ip-detect
This file contains 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
#!/usr/bin/env bash | |
set -o nounset -o errexit | |
export PATH=/usr/sbin:/usr/bin:$PATH | |
echo $(ip addr show eth0 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment