Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Script to Notify of Public IP Change

by Kenosis (Priest)
on Nov 29, 2012 at 16:37 UTC ( #1006296=note: print w/ replies, xml ) Need Help??


in reply to Script to Notify of Public IP Change

marto makes a good point about asking the ISP about whether a static or dynamic IP is provided. In the meantime, perhaps something like the following would be helpful:

#!/usr/bin/env perl use strict; use warnings; use LWP::Simple; use Regexp::Common qw/net/; my $ip; for ( 0 .. 9 ) { chomp( $ip = get('http://ip-addr.es/') ); last if defined $ip and $ip =~ /$RE{net}{IPv4}/; sleep 1; } ...


Comment on Re: Script to Notify of Public IP Change
Download Code
Re^2: Script to Notify of Public IP Change
by Arkevius (Initiate) on Nov 29, 2012 at 16:52 UTC
    There seems to be a much faster response time (at least for me) with that address than with the one I currently use. I may very well substitute that bit of code with yours. Thank you for the contribution. I do agree with marto that the best solution would be talk with the ISP. However, in the interest of continuing my experience and learning of Perl, I went with the script, at least for now. I just wanted to clear up the cause of the blank address, which seems to just be an error in parsing the address.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006296]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-12-26 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (164 votes), past polls