--- Customization.pm.orig 2017-07-27 20:21:04.259828942 +0200 +++ Customization.pm.new 2017-07-27 20:21:35.559476473 +0200 @@ -756,17 +756,17 @@ if (! defined $ifcfgResult) { $ifcfgResult = Utils::ExecuteCommand('/sbin/ifconfig -a'); } + + my @interfaces = split/\n\n/, $ifcfgResult; - my $result = undef; - - my $macAddressValid = ($macAddress =~ /^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i); - - if ($macAddressValid && - ($ifcfgResult =~ /^\s*(\w+?)(:\w*)?\s+.*?$macAddress/mi)) { - $result = $1; + foreach my $interface (@interfaces) { + if ($interface =~ /$macAddress/) { + print($interface); + if ($interface =~ m/^(\w+)(:|\s)/) { + return $1; + } + } } - - return $result; } sub GetInterfaceByMacAddressIPAddrShow