Hi, I'm running an Ubuntu 8.04.1 server on a DHCP network (not behind a router), and although it doesn't happen often I'm afraid the IP address of the server will change and I won't be able to access it anymore. Also, sometimes the modem crashes and comes back up but leaves the server without a connection. Right now I set up a script to basically do ifdown/ifup daily to ensure that if the modem crashes and it loses an IP it will get it back within a day. But, I'm afraid that it will get a different IP when it does this. Is there a way to have the server email me with it's IP address, say, once a week? Also, with my ifdown/ifup script, is there a way to not have any output from the ifdown/ifup commands? Right now I get a "mail" message daily on my server with the output of ifdown/ifup and it's kind of cluttered and annoying to delete. I'm not familiar at all with sending emails via a terminal. Thanks in advance!
By the way, my idea was to perhaps send me an email with the contents of "wget http://whatismyip.org", since it would only contain the current IP address. Or perhaps getting the IP address via some internal method would work better.
Bookmarks