Skip to content

Instantly share code, notes, and snippets.

@billrafferty
Created August 12, 2022 08:15
Show Gist options
  • Save billrafferty/798320e9f172d3057c6992d0f1b7f68f to your computer and use it in GitHub Desktop.
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
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