Skip to content

Instantly share code, notes, and snippets.

@nvk
Created April 8, 2013 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvk/5340940 to your computer and use it in GitHub Desktop.
Save nvk/5340940 to your computer and use it in GitHub Desktop.
ip(){
hrline 36
# Gets external IP from opendns.com
print -P "%F{240}|%f %F{$colorInfo}=> External IP%f `dig +short myip.opendns.com @resolver1.opendns.com` %F{240}|%f"
# Get's local IP from ipconfig
print -P "%F{240}|%f %F{$colorSecondary}=> Local IP %f `ipconfig getifaddr en0` %F{240}|%f"
# make line, https://gist.github.com/nvk/5340820
hrline 36
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment