perl or shell for ip manipulation

Discussion in 'Perl' started by Dave, Dec 22, 2007.

  1. Dave

    Dave Guest

    Hello,
    I'm wanting to develope a script for ip change notification. Since my
    box doesn't change cleanly, i'd like to run this script from cron say every
    30 minutes. First thing it does is checks the IP, if it's the same as 30
    minutes ago it pings one of about ten sites from a list in random order. If
    that works, everything is well exit. If not meaning the ip test reports the
    same as 30 minutes ago but pinging that list returns nothing then run three
    commands, obtain the new ip, save it, and send an email to a designated
    address.
    I'm not sure if i should do this in shell or perl, as of right now i
    have the ip address printing, but i believe i'd have to do something with
    saving state between script loads, this i've never done. If anyone has any
    suggestions i'd appreciate them.
    Thanks.
    Dave.
    Dave, Dec 22, 2007
    #1
    1. Advertising

  2. On Sat, 22 Dec 2007 00:47:09 -0500, "Dave" <> wrote:

    >have the ip address printing, but i believe i'd have to do something with
    >saving state between script loads, this i've never done. If anyone has any
    >suggestions i'd appreciate them.


    The only non-volatile storage in a computer system are files. So just
    write that IP address to a file and read its content again in the next
    run.

    jue

    PS: this single newsgroup has been replaced by the whole comp.lang.perl.*
    hierarchy about a decade ago and is no longer maintained
    Jürgen Exner, Dec 22, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    5,643
    Jonathan Bromley
    Feb 18, 2005
  2. Christian Heimes
    Replies:
    0
    Views:
    580
    Christian Heimes
    Feb 27, 2008
  3. Gerardo Herzig
    Replies:
    1
    Views:
    1,055
    Philipp Pagel
    Feb 27, 2008
  4. D'Arcy J.M. Cain
    Replies:
    0
    Views:
    842
    D'Arcy J.M. Cain
    Feb 27, 2008
  5. Bernard Lambeau
    Replies:
    0
    Views:
    479
    Bernard Lambeau
    Jun 19, 2011
Loading...

Share This Page