LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2004, 10:20 AM   #1
ericnmu
LQ Newbie
 
Registered: Jul 2004
Location: Madison, WI
Posts: 21

Rep: Reputation: 15
bash script to email updated ip


Hi all. There is my problem. Everyone once in a great while I will need to restart my Redhat server. For now I have been relying on a dynamic DNS issued by my school: helios.resnet.nmu.edu (server address). Because the admins here are retards, they sometimes drops my hostname from the DNS.
I have tried using dynamic dns accounts at various free places, but I cannot for the life of me get the clients to work.

Anyways, I was talking with a friend who said writing a bash script to email me anytime the IP changes (that includes when I restart it).
Cool... but I have 0 experience with bash scripting. I know this would be a good place to start, but its still a little over my head.

So I was wondering if anyone out there had sometime smiliar, or the same as this, and wouldnt mind sharing it.
Thanks for your time.

Eric
 
Old 10-01-2004, 11:30 PM   #2
ericnmu
LQ Newbie
 
Registered: Jul 2004
Location: Madison, WI
Posts: 21

Original Poster
Rep: Reputation: 15
If anyone would like to do the same, here is what I used. It works great:

ifconfig | head | grep "inet addr" | mail -s newip emailaddress
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Write a script to send an email from bash kpelczar Linux - Software 5 02-09-2005 05:19 PM
Bash script to email setuid root files deoren LinuxQuestions.org Member Success Stories 1 01-30-2005 10:56 AM
Bash script to alert by email 3 times then stop. pmpc00 Linux - General 2 11-04-2004 08:23 AM
Writing init script for Firestarter on updated Fedora 1 (today) lrt2003 Fedora 5 04-18-2004 03:58 PM
bash script, parsing email addresses kepler Programming 6 01-26-2004 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:37 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