Created
March 20, 2018 14:25
-
-
Save Juszczak/152afe0ecd812c1047a287e08a806825 to your computer and use it in GitHub Desktop.
Fast IP info by greping ifconfig for local and DNS lookup for global (used as tmux plugin)
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
| #!/usr/bin/env bash | |
| declare glob; glob="$(dig +short myip.opendns.com @resolver1.opendns.com)"; | |
| declare local; local="$(ifconfig en4 | grep 'inet ' | awk '{print $2}')" | |
| declare out; out="$local | $glob" | |
| echo "$out" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment