Fixing #28: FreeDNS.afraid.org changed api slightly
git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@126 3873ddee-7413-0410-b6c4-c2c57c1ab35a
This commit is contained in:
parent
1b4c31b82e
commit
790c3f8966
1 changed files with 15 additions and 4 deletions
17
ddclient
17
ddclient
|
@ -3552,15 +3552,26 @@ sub nic_freedns_update {
|
||||||
info("setting IP address to %s for %s", $ip, $h);
|
info("setting IP address to %s for %s", $ip, $h);
|
||||||
verbose("UPDATE:","updating %s", $h);
|
verbose("UPDATE:","updating %s", $h);
|
||||||
|
|
||||||
if($ip ne $freedns_hosts{$h}->[1]) {
|
if($ip eq $freedns_hosts{$h}->[1]) {
|
||||||
|
$config{$h}{'ip'} = $ip;
|
||||||
|
$config{$h}{'mtime'} = $now;
|
||||||
|
$config{$h}{'status'} = 'good';
|
||||||
|
success("update not necessary %s: good: IP address already set to %s", $h, $ip);
|
||||||
|
} else {
|
||||||
my $reply = geturl(opt('proxy'), $freedns_hosts{$h}->[2]);
|
my $reply = geturl(opt('proxy'), $freedns_hosts{$h}->[2]);
|
||||||
if (!defined($reply) || !$reply) {
|
if (!defined($reply) || !$reply) {
|
||||||
failed("updating %s: Could not connect to %s.", $h, $freedns_hosts{$h}->[2]);
|
failed("updating %s: Could not connect to %s.", $h, $freedns_hosts{$h}->[2]);
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
last if !header_ok($h, $reply);
|
if(!header_ok($h, $reply)) {
|
||||||
|
$config{$h}{'status'} = 'failed';
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
|
||||||
if($reply =~ /Updated.*host/) {
|
if($reply =~ /Updated.*$h.*to.*$ip/) {
|
||||||
|
$config{$h}{'ip'} = $ip;
|
||||||
|
$config{$h}{'mtime'} = $now;
|
||||||
|
$config{$h}{'status'} = 'good';
|
||||||
success("updating %s: good: IP address set to %s", $h, $ip);
|
success("updating %s: good: IP address set to %s", $h, $ip);
|
||||||
} else {
|
} else {
|
||||||
$config{$h}{'status'} = 'failed';
|
$config{$h}{'status'} = 'failed';
|
||||||
|
|
Loading…
Reference in a new issue