LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Script to capture dynamic IP address (https://www.linuxquestions.org/questions/linux-general-1/script-to-capture-dynamic-ip-address-46419/)

scon 02-20-2003 09:17 PM

Script to capture dynamic IP address
 
Hello,

I need a script to capture my dynamically generated IP address (cable connection), and then have this info emailed to a remote address.

I found a few, but they are all for ppp connections.

Thanks,
scon

crabboy 02-20-2003 09:47 PM

How about something like this?

Code:

ifconfig eth0 | awk  '/inet addr/ { print $2 } ' | mail dude@address.com

scon 02-21-2003 03:14 AM

Thanks crabboy, that code looks spot on. Would it now be possible to have this address checked and e-mailed on a daily basis and/or at certain times.

Sorry if I am pushing my luck.

scon

acid_kewpie 02-21-2003 03:18 AM

just put it in a cron job

scon 02-21-2003 03:30 AM

Thanks acid_kewpie and crabboy


All times are GMT -5. The time now is 04:17 AM.