terça-feira, 13 de novembro de 2012

Recuperar o ip externo



fonte http://meuip.datahouse.com.br/internas/ip.php

Para recuperar via terminal

$curl -s http://meuip.datahouse.com.br/internas/ip.php | egrep '<span class="titulo-ip">.*<\/span>' -o

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1671    0  1671    0     0   4981      0 --:--:-- --:--:-- --:--:--  6258
<span class="titulo-ip"> 189.19.180.248</span>


OU

$curl ifconfig.me





fonte : http://ip-api.com/json

Nenhum comentário:

Postar um comentário