Created
November 3, 2016 20:14
-
-
Save kojiromike/2049c5d90a7ae0c868f77b90a2c14568 to your computer and use it in GitHub Desktop.
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
for nic in /sys/class/net/e*; do | |
[[ -h $nic ]] || continue | |
/sbin/ifconfig "${nic##*/}" | awk -F: '/inet addr:/{ print $2; exit }' | |
break | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment