Skip to content

Instantly share code, notes, and snippets.

@jriguera
Last active August 29, 2015 14:20
Show Gist options
  • Save jriguera/8dcec90a3a9dad04ba25 to your computer and use it in GitHub Desktop.
Save jriguera/8dcec90a3a9dad04ba25 to your computer and use it in GitHub Desktop.
getting the public ip
#!/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