Skip to content

Commit

Permalink
better interface selection
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Dec 25, 2012
1 parent 08c154e commit 4cfa481
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/FusionInventory/Agent/Task/WakeOnLan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ sub _getInterface {
}
}

# let's take the first interface with an IP adress, a MAC address
# different from the loopback
$ENV{LC_ALL} = 'C';
my $interface =
first { $_->{MACADDR} }
first { $_->{DESCRIPTION} ne 'lo' }
grep { $_->{IPADDRESS} }
grep { $_->{MACADDR} }
$function->(logger => $self->{logger});

return $interface;
Expand Down

0 comments on commit 4cfa481

Please sign in to comment.