snippets / Connaître son adresse ip

Language: Shell - First posted by raf on 2007-10-6 10:07 (1 year)
Link to the snippet: http://www.friendsnippets.org/snippet/85/

-- Nécessite le programme links

1 #!/bin/bash
2
3 links -dump http://www.whatismyip.com/automation/n09230945.asp | sed -e 's/ //g'
In order to post a comment, you should have a friendsnippet account. Please sign-in.

2 comments

  • October 8th 2007 at 13:07

    Ceci est plus simple, avec curl :

    1 curl http://whatismyip.org
  • October 7th 2007 at 12:26

    For a more insider point of view, this works at home:

    1 #!/bin/bash
    2 /sbin/ifconfig |grep "inet adr"|grep -v "127.0.0.1"|cut -f2 -d ":"|cut -f1 -d" "
Oct '07
  • -- Nécessite le programme links