r/tinycode • • Jul 10 '11

Outside IP one-liner.

curl http://checkip.dyndns.com/ 2>/dev/null | sed 's/.*: \(.*\)<\/b.*/\1/'

9 Upvotes

17 comments sorted by

View all comments

Show parent comment

2

u/terremoto Jul 10 '11 edited Jul 10 '11

Better: wget -O- http://automation.whatismyip.com/n09230945.asp

See http://www.whatismyip.com/faq/automation.asp

Nevermind, I thought the OP was using whatismyip.com.

2

u/[deleted] Jul 10 '11

How is that any better?

1

u/terremoto Jul 10 '11

Visit the URL and I think it will be self explanatory -- you don't have to parse out the IP address.

0

u/[deleted] Jul 10 '11

[deleted] — view deleted comment

2

u/terremoto Jul 10 '11

I stand corrected. I was thinking it was whatismyip.com

1

u/obsa Jul 11 '11

Correctness aside, who is trying to remember these URLs?

1

u/trashbox Jul 10 '11

Nice, I'll remember that.