From freek@opensuse.org Wed May 31 09:48:30 2017 From: Freek de Kruijf To: users@lists.opensuse.org Subject: Re: [opensuse] How can I get the external IP on a script? Date: Wed, 31 May 2017 11:48:14 +0200 Message-ID: <4243981.ZPskKWoXSK@eiktum.beelaertsict.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4582301458503724682==" --===============4582301458503724682== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Op woensdag 31 mei 2017 11:02:31 CEST schreef Carlos E. R.: > Hi, > > In order to get the external IP on a script I used (Dec 2015) this one > liner: > > wget -qO - checkip.dyndns.org | cut -d":" -f2 | cut -d"<" -f1 > > and this is failing now (returns empty), but I'm unable (ie, too thick > today) to see why. The output of the wget run is: > > cer(a)minas-tirith:~> wget -qO - checkip.dyndns.org > Current IP CheckCurrent IP Address: > 2.141.215.163 cer(a)minas-tirith:~> > > Something has changed, no idea what. > > > Meanwhile, looking on google, I got another simpler oneliner (from > https://coderwall.com/p/lmi2jw/get-external-ip-in-a-script): > > curl http://icanhazip.com > > they also suggest using http://ifconfig.me/ip instead, but it fails: > > cer(a)minas-tirith:~> curl http://icanhazip.com > 2.141.215.163 > cer(a)minas-tirith:~> curl http://checkip.dyndns.org > cer(a)minas-tirith:~> curl http://ifconfig.me/ip > cer(a)minas-tirith:~> > > All sites work on a browser, but only http://icanhazip.com works on the CLI > with curl. Why? On my up-to-date Tumbleweed system all these commands work as they should. -- fr.gr. member openSUSE Freek de Kruijf -- To unsubscribe, e-mail: opensuse+unsubscribe(a)opensuse.org To contact the owner, e-mail: opensuse+owner(a)opensuse.org --===============4582301458503724682==-- From robin.listas@gmail.com Wed May 31 11:11:11 2017 From: "Carlos E. R." To: users@lists.opensuse.org Subject: Re: [opensuse] How can I get the external IP on a script? Date: Wed, 31 May 2017 13:11:02 +0200 Message-ID: In-Reply-To: <4243981.ZPskKWoXSK@eiktum.beelaertsict.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0995473459516364732==" --===============0995473459516364732== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2017-05-31 11:48, Freek de Kruijf wrote: > Op woensdag 31 mei 2017 11:02:31 CEST schreef Carlos E. R.: >> Hi, >> >> In order to get the external IP on a script I used (Dec 2015) this one >> liner: >> >> wget -qO - checkip.dyndns.org | cut -d":" -f2 | cut -d"<" -f1 >> >> and this is failing now (returns empty), but I'm unable (ie, too thick >> today) to see why. The output of the wget run is: >> >> cer(a)minas-tirith:~> wget -qO - checkip.dyndns.org >> Current IP CheckCurrent IP Address: >> 2.141.215.163 cer(a)minas-tirith:~> >> >> Something has changed, no idea what. >> >> >> Meanwhile, looking on google, I got another simpler oneliner (from >> https://coderwall.com/p/lmi2jw/get-external-ip-in-a-script): >> >> curl http://icanhazip.com >> >> they also suggest using http://ifconfig.me/ip instead, but it fails: >> >> cer(a)minas-tirith:~> curl http://icanhazip.com >> 2.141.215.163 >> cer(a)minas-tirith:~> curl http://checkip.dyndns.org >> cer(a)minas-tirith:~> curl http://ifconfig.me/ip >> cer(a)minas-tirith:~> >> >> All sites work on a browser, but only http://icanhazip.com works on the CLI >> with curl. Why? > > On my up-to-date Tumbleweed system all these commands work as they should. Wow! That's a surprise. What is wrong, then? -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith)) --===============0995473459516364732== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjIKCmlGNEVBUkVJ QUFZRkFsa3VwTWNBQ2drUWphOFViY1VXTTF5ZVl3RC9URnlSaW5qM25sRGJiTmlEUXNhQzcxdWkK ZVk3Yk1ONys4azAyNVlWNlYvRUEvUkNobDIxYkdQM1U3TDVsU2crWHJ3L0pNUStocjYrYm45WkFK c2x5RjdqLwo9RC9RQwotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============0995473459516364732==--