Fixing bug #13: multiple fetch-ip but introducing a multiple ip bug
git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@121 3873ddee-7413-0410-b6c4-c2c57c1ab35a
This commit is contained in:
parent
4edbb7a3e9
commit
e406318257
1 changed files with 48 additions and 37 deletions
13
ddclient
13
ddclient
|
@ -741,6 +741,7 @@ sub runpostscript {
|
|||
######################################################################
|
||||
sub update_nics {
|
||||
my %examined = ();
|
||||
my %iplist = ();
|
||||
|
||||
foreach my $s (sort keys %services) {
|
||||
my (@hosts, %ips) = ();
|
||||
|
@ -752,7 +753,15 @@ sub update_nics {
|
|||
$examined{$h} = 1;
|
||||
my $use = $config{$h}{'use'} || opt('use');
|
||||
local $opt{$use} = $config{$h}{$use} if $config{$h}{$use};
|
||||
my $ip = get_ip($use, $h);
|
||||
# bug #13: we should only do this once
|
||||
# use isn't enough, we have to save the origin to.
|
||||
# this will break the multiple ip stuff if use has
|
||||
# been used twice for the same device.
|
||||
my $ip = "";
|
||||
if (defined $iplist{$use}) {
|
||||
$ip = $iplist{$use};
|
||||
} else {
|
||||
$ip = get_ip($use, $h);
|
||||
if (!defined $ip || !$ip) {
|
||||
warning("unable to determine IP address")
|
||||
if !$daemon || opt('verbose');
|
||||
|
@ -762,6 +771,8 @@ sub update_nics {
|
|||
warning("malformed IP address (%s)", $ip);
|
||||
next;
|
||||
}
|
||||
$iplist{$use} = $ip;
|
||||
}
|
||||
$config{$h}{'wantip'} = $ip;
|
||||
next if !nic_updateable($h, $updateable);
|
||||
push @hosts, $h;
|
||||
|
|
Loading…
Reference in a new issue