#!/usr/bin/perl # This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. # http://herselfswebtools.com # Linda MacPhee-Cobb" # a tool to get non static ip address when #you have a router installed, this also works if you do not #have a router. #this assumes you are running osx and sendmail if you are #get current ip address use LWP::Simple; use Mail::Mailer; #get page with ip info $html = get( 'http://checkip.dyndns.org' ); $html =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/; my $ip1 = "$1"; my $ip2 = "$2"; my $ip3 = "$3"; my $ip4 = "$4"; my $ip = "$ip1.$ip2.$ip3.$ip4"; open (MAIL, "|/usr/sbin/sendmail -t "); print MAIL "From: you\@somewhere.com\n"; print MAIL "To: somebody\@ip.com\n"; print MAIL "Content-Type: text/plain\n"; print MAIL "Subject: * IP Number\n\n"; print MAIL "\n\n $ip \n\n"; close (MAIL);