Last active
August 29, 2015 14:20
-
-
Save jriguera/8dcec90a3a9dad04ba25 to your computer and use it in GitHub Desktop.
getting the public ip
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 | |
dev=$1 | |
ping -c 1 -I $dev ifconfig.me && \ | |
echo "Public ip: $(curl -s --interface $dev ifconfig.me/host) $(curl -s --interface $dev ifconfig.me/ip)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment