cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Updating dynamic IP address with curl

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Mon, 24 Aug 2015 20:06:18 +0200

Csányi Pál wrote:

> I want to use following command with curl:
> http://[USERNAME]:[PASSWORD]@update.ipdns.hu/update?hostname=[DOMAIN]&myip=[IP]
>
> So the command could be eg.
> curl -v http://username-gmail-com:password@update.ipdns.hu/update?hostname=somename.ipdns.hu&myip=95.85.***.***
>
> My question is: can one use this command as a cron job to execute
> every say 10 minutes but so so the current IP address of the eth0
> network interface should be substituted automatically into this
> command at ..myip=CurrentIPaddress?

I don't know about cron, but you can put something like this in
your ~./netrc:
   machine ipdns.no login username-gmail-com password password-for-update-ipdns.no

to simplify that cmd-line.

But the 'myip=CurrentIPaddress' should be your WAN-address, no?
(not the "current IP address of the eth0"). How do you obtain that?

-- 
--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-24