nathanvit,
I do not like this one bit - you really need to consider what could go wrong and try to develop a solution with that stuff in mind. For instance - is the reason the router changes it's IP everyday for security? If yes, you are now sending the IP in an email over the Internet. Only you will know the things that could go wrong, so I won't get up on a soapbox.

  • Create an alias that pipes the email to a script getip : "| /usr/local/bin/get_ip.pl"
  • In the get_ip.pl script, have it ping your broadcast 192.168.0.255 for instance
  • Have the script then perform an arp -a
  • You will have to hardcode the MAC address of the router so it will know what to look for - use a regex to extract the IP address
  • Finally, have the script send the IP to your home address system("echo $ip | mailx -s "today's IP" youraccount\@nowhere.com");

    Best of luck - L~R


    In reply to Re: ip and router by Limbic~Region
    in thread ip and router by nathanvit

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.