Skip to content

Instantly share code, notes, and snippets.

@drjova
Created February 27, 2014 22:15
Show Gist options
  • Save drjova/9260793 to your computer and use it in GitHub Desktop.
Save drjova/9260793 to your computer and use it in GitHub Desktop.
Return my IP
function my_ip() # Get IP adress on ethernet.
{
MY_IP=$(/sbin/ifconfig en0 | awk '/inet/ { print $2 } ' |
sed -e s/addr://)
echo ${MY_IP:-"Not connected"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment