Last active
September 20, 2017 13:04
-
-
Save dusansimic/6145bd3674f7a53c11127bd18b904786 to your computer and use it in GitHub Desktop.
Get your public ip address with one simple script.
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 | |
printf "Local: %s\n" "$(ifconfig enp3s0 | grep 'inet ' | awk '{ print $2}')" | |
printf "Global: %s\n" "$(dig +short myip.opendns.com @resolver1.opendns.com)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment