Hello, I am trying to use a PERL script to get the IP addy assigned to my box Via DHCP. I have a Nix box set up as a gateway/router right before my broadband connection. I would like to be able to SSH into this box at any time, from anywhere, but my ISP gives me a dynamic IP assigned through DHCP. I am trying to find a way to create a PERL script that will find the assigned IP of this box, throw it in a text file, and upload it to an FTP server. I just dont know how to find out the IP using PERL. I am thinking of parsing the assigned IP out of the DHCPcd logs or some thing similar. Is there an easier way to do this? If so, what is it? If there isn't, how would i go about making PERL check these logs when ever there is activity, to find out if there was a change in the IP? Thanx for any input on this problem in advance guys. By the way, i am a totally new to PERL, but an working on learning it as part of this project. Thanks --a2K

In reply to Finding the IP of a local box by a2K

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.