Code:
#!/usr/bin/perl -w
use strict;
# Complete the following variables
my $domain_name = "";
my $username = "";
my $password = "";
#No need to modify script following this line
my $dynaddr = `dig +short $domain_name`;
my $newaddr = `wget --quiet -O - http://cgi.internode.on.net/cgi-bin/showmyip?textonly=1`;
chomp($dynaddr);
chomp($newaddr);
if ($dynaddr ne $newaddr)
{
`lynx -source -auth=$username:$password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=$domain_name'`;
}
exit;
I'm not a Perl coder (actually, I prefer Python.) Nonetheless, the above is a little more succinct.
Bookmarks