How do I email a remote computer IP to myself automatically?
-
- Posts: 8696
- Joined: Fri Dec 15, 2000 8:00 am
How do I email a remote computer IP to myself automatically?
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?
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
`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).
* 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).
-
- Posts: 8696
- Joined: Fri Dec 15, 2000 8:00 am
Re: How do I email a remote computer IP to myself automatically?
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.
I was messing with my home router today then realised this was probably possible.
-
- Posts: 8696
- Joined: Fri Dec 15, 2000 8:00 am
Re: How do I email a remote computer IP to myself automatically?
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.
Good stuff.