cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Extreme newbie question re: uploading from stdin fails to deliver expected content

From: hunter <theantigod_at_sympatico.ca>
Date: 21 Feb 2004 13:03:13 -0500

On Sat, 2004-02-21 at 12:19, Paul J Travers wrote:
> Dear All,
>
> here is the problem .. I am trying to write a little command
> line so that my computer at home will find out what the IP of the
> router is at regular intervals and will forward that information to a
> central site where I can access it. The idea is that I can always
> know what address to use to be able to access my home computer from
> work, or wherever I happen to be.
>
> The command string I have is:
> curl -s whatismyip.com | grep "Your IP is" | curl -T - -u <user:pwd>
> http://idisk.mac.com/pjtravers/Documents/myIP.html
>
> The first curl command gets a web page containing the IP address I
> appear to be coming from.
> The grep extracts the line containing that information
> The second curl is supposed to write that line into a remote web page.
>
> the commands work up to the grep .. which outputs eg
> <h1>Your IP is 194.203.157.2 <br></h1>
>
> The second curl command works insofar as it creates the output file,
> but the file is empty ..ie the output from the grep command does not
> appear in the new file. As I understand it, the "-T -" switch should
> tell curl to take it's input from stdin, ie, from the output of the
> grep command. Or have I missed something somewhere?
>
> The output from the command is:
> % Total % Received % Xferd Average Speed Time Curr.
> Dload Upload Total Current Left Speed
> 100 40 0 0 0 40 0 87 --:--:-- 0:00:00 --:--:-- 0
>
> There's probably an embarrassingly simple explanation for this
> behaviour, but it's beyond my limited knowledge. Can anyone help?
>
> Paul T
>
> --
> Dr Paul J Travers
> Deputy Director
> Anthony Nolan Research Institute Tel: +44(0)207284 8311
> The Royal Free Hospital Fax: +44(0)207284 8331
> Pond Street
> London NW3 2QG

Seems a little unessary to me.

Why not use a free domain service like DynDNS.org

http://www.dyndns.org

There are loads of client applications available that will periodically
update your DynDNA account.

I use one called 'dsclient' on Debian GNU/Linux but I also found many
for Windows as well.

Check it out ... I think it fits what you are trying to do.

Chris
 
Received on 2004-02-21