Page 1 of 1

How do I email a remote computer IP to myself automatically?

Posted: Thu Aug 02, 2007 4:22 pm
by Massive Quasars
I'd like to setup a remote computer that checks and emails it's IP periodically (everyday), what's the easiest way to go about doing this?

Posted: Thu Aug 02, 2007 7:33 pm
by ^misantropia^
`crontab -e` and add:

* 12 * * * ifconfig eth0 | perl -ne '/inet addr:([\d\.]*)/ && print $1' | mail -s "IP address" you@isp.com

That'll mail the IP address every day at noon (*NIX only, obviously).

Posted: Thu Aug 02, 2007 9:02 pm
by Massive Quasars
Thanks misantropia.

riddla could you expand on that.

Posted: Thu Aug 02, 2007 11:55 pm
by Massive Quasars
Sorted, thanks riddla.

Re: How do I email a remote computer IP to myself automatically?

Posted: Sun Aug 05, 2007 10:46 pm
by Foo
I had another idea also. Some home routers come with a feature to email the router log periodically. While the log usually won't contain the routers external IP, the email header will.

I was messing with my home router today then realised this was probably possible.

Re: How do I email a remote computer IP to myself automatically?

Posted: Sun Aug 19, 2007 9:41 am
by Massive Quasars
After loading the DD-WRT firmware on my router, I found out that it supports many of these online services (DynDNS, No-IP, etc.). It can communicate the IP to these sites in place of a computer.

Good stuff.