Script to email current IP address

Associate
Joined
3 Jul 2011
Posts
548
Hi, I'm wanting to write a script to email me the IP address of a remote machine periodically or if the IP changes.

So far I have this
Code:
ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
this outputs the IP address that I want to email to myself.

The questions I have are how can I set this script on startup and to run every hour?

How can I pipe the output of this script into an email using the command prompt?

Thanks
 
Back
Top Bottom