Created
July 19, 2023 02:45
-
-
Save oanhnn/c168f91d498e64eba466d62b02474b65 to your computer and use it in GitHub Desktop.
Show My IP on MacOS
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
#!/bin/bash | |
echo "Public IP:" $(curl -s ifconfig.me) | |
echo "Private IP:" | |
echo "- en0:" $(ipconfig getifaddr en0 || echo 'Not connected') | |
echo "- en5:" $(ipconfig getifaddr en5 || echo 'Not connected') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment