Posted By


ksaver on 08/22/10

Tagged


Statistics


Viewed 1294 times
Favorited by 0 user(s)

get_external_ip.sh


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # snippet: get_external_ip.sh
  2. # version: 0.02
  3. # author: ksaver (at identi.ca)
  4. # license: Public Domain
  5. # arguments: Not required.
  6. # sets: extern_ip function
  7. # returns: Numerical External IP
  8. # usage: Use into a script:
  9. # source get_external_ip.sh
  10. # echo "My external IP is: $(extern_ip)"
  11.  
  12. function extern_ip()
  13. {
  14. URL="http://whatismyip.org/"
  15. curl -s $URL || wget -qO- $URL || lynx -dump $URL
  16. }

URL: http://identi.ca/ksaver

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.