Created
August 12, 2022 08:15
-
-
Save billrafferty/798320e9f172d3057c6992d0f1b7f68f to your computer and use it in GitHub Desktop.
Fish Shell https://fishshell.com/ function script that echo's out local mac WiFi address and public IP via google DNS query.Could also be done via curl http://ipinfo.io but looks clean and has emoji so happy to have on terminal startup
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
function myip | |
echo local WiFi IP ᯤ; | |
command ifconfig en0 | grep -o 'inet .\{0,16\}\s' | |
echo public IP 🌐; | |
command dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | grep '.' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment