Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-30-2004, 10:20 AM   #1
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: (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.

Old 10-01-2004, 11:30 PM   #2
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


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 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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:04 PM.

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