LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-20-2003, 09:17 PM   #1
scon
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat Mandrake Debian
Posts: 6

Rep: Reputation: 0
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
 
Old 02-20-2003, 09:47 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
How about something like this?

Code:
ifconfig eth0 | awk  '/inet addr/ { print $2 } ' | mail dude@address.com
 
Old 02-21-2003, 03:14 AM   #3
scon
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat Mandrake Debian
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 02-21-2003, 03:18 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
just put it in a cron job
 
Old 02-21-2003, 03:30 AM   #5
scon
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat Mandrake Debian
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks acid_kewpie and crabboy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fix ip address vs Dynamic ip address yenonn Linux - Networking 5 04-13-2004 07:25 AM
Dynamic Screen Capture On Linux stakcbr Linux - Software 0 07-23-2003 01:28 PM
What is the slickest way to use a dynamic ip address for a server? lostboy Linux - General 7 07-05-2003 10:56 PM
How to find out dynamic IP address in a script? J_Szucs Linux - Networking 1 06-09-2003 07:13 PM
dynamic IP address acid_kewpie Linux - Networking 4 09-13-2001 02:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration