From 9fcb68ad8748f2d85ba27f36d6c1ff08ba5f8200 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 1 Sep 2004 03:44:09 +0000 Subject: do not use find over grep, just find --- perl-install/network/tools.pm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 6fa8173a2..d77a934e1 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -239,26 +239,19 @@ sub find_matching_interface { #- returns first dhcp interface started on boot sub get_default_ethernet_dhcp_interface { my ($intf) = @_; - find { - text2bool($intf->{$_}{ONBOOT}) && $intf->{$_}{BOOTPROTO} eq 'dhcp' - } grep { /^eth\d+/ } sort keys %$intf; + find { /^eth\d+/ && text2bool($intf->{$_}{ONBOOT}) && $intf->{$_}{BOOTPROTO} eq 'dhcp' } sort keys %$intf; } - #- returns first ppp interface started on boot sub get_default_ppp_interface { my ($intf) = @_; - find { - text2bool($intf->{$_}{ONBOOT}) - } grep { /^ppp\d+/ } sort keys %$intf; + find { /^ppp\d+/ && text2bool($intf->{$_}{ONBOOT}) } sort keys %$intf; } #- returns ippp interface dialed on boot sub get_default_ippp_interface { my ($intf) = @_; - find { - text2bool($intf->{$_}{ONBOOT}) && text2bool($intf->{$_}{DIAL_ON_IFUP}) - } grep { /^ippp\d+/ } sort keys %$intf; + find { /^ippp\d+/ && text2bool($intf->{$_}{ONBOOT}) && text2bool($intf->{$_}{DIAL_ON_IFUP}) } sort keys %$intf; } #- returns gateway interface if found -- cgit v1.2.1