Return to Snippet

Revision: 30793
at August 22, 2010 16:03 by ksaver


Initial Code
#  snippet:    get_external_ip.sh
#  version:    0.02
#  author:     ksaver (at identi.ca)
#  license:    Public Domain
#  arguments:  Not required.
#  sets:       extern_ip function
#  returns:    Numerical External IP
#  usage:      Use into a script:
#              source get_external_ip.sh
#              echo "My external IP is: $(extern_ip)"

function extern_ip()
{
    URL="http://whatismyip.org/"
    curl -s $URL || wget -qO- $URL || lynx -dump $URL
}

Initial URL
http://identi.ca/ksaver

Initial Description

                                

Initial Title
get_external_ip.sh

Initial Tags
curl, Bash, ip

Initial Language
Bash