diff options
author | Papoteur <papoteur@mageia.org> | 2021-02-06 19:17:46 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-02-06 19:17:46 +0100 |
commit | 0f3db20184530901ea37e9aa101afa400bba5767 (patch) | |
tree | 98a1f47e67f7d965ddafd27b1c2fc8546a1442db | |
parent | a4fba2e30594b74c77b607dc6131db9fe5bb26ec (diff) | |
download | drakwizard-0f3db20184530901ea37e9aa101afa400bba5767.tar drakwizard-0f3db20184530901ea37e9aa101afa400bba5767.tar.gz drakwizard-0f3db20184530901ea37e9aa101afa400bba5767.tar.bz2 drakwizard-0f3db20184530901ea37e9aa101afa400bba5767.tar.xz drakwizard-0f3db20184530901ea37e9aa101afa400bba5767.zip |
Exit last instructions from the loop on interfaces. Formatting code.
-rw-r--r-- | common/IFCFG.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/common/IFCFG.pm b/common/IFCFG.pm index 3c4b76ea..39ab0fb4 100644 --- a/common/IFCFG.pm +++ b/common/IFCFG.pm @@ -23,7 +23,6 @@ package MDK::Wizard::IFCFG; use strict; use lib qw(/usr/lib/libDrakX); -use Data::Dumper; use MDK::Common; use network::network; use detect_devices; @@ -70,11 +69,12 @@ sub new { if( detect_devices::is_lan_interface($device)) { $_ = `/sbin/ip -4 address show dev $device |grep inet`; my ($ip, $netmask, $bcast,) = /inet\s([0-9\.]*)\/([0-9]*)\sbrd\s([0-9\.]*)/; - if (defined $ip && defined $bcast && defined $netmask) { - $self->{itf}{$device} = { IPADDR => $ip, BROADCAST => $bcast, NETMASK => $netmask }; - my %conf = getVarsFromSh("/etc/sysconfig/network-scripts/ifcfg-$device"); - $self->{itf}{$device}{$_} = $conf{$_} foreach 'BOOTPROTO'; - } + if (defined $ip && defined $bcast && defined $netmask) { + $self->{itf}{$device} = { IPADDR => $ip, BROADCAST => $bcast, NETMASK => $netmask }; + my %conf = getVarsFromSh("/etc/sysconfig/network-scripts/ifcfg-$device"); + $self->{itf}{$device}{$_} = $conf{$_} foreach 'BOOTPROTO'; + } + } } %{$self->{network}} = getVarsFromSh("/etc/sysconfig/network"); my $r = network::network::read_resolv_conf(); @@ -84,7 +84,6 @@ sub new { $self->{network}{HOSTNAME} ||= `/bin/hostname` and chomp $self->{network}{HOSTNAME}; ($self->{network}{DOMAINNAME}) = $self->{network}{HOSTNAME} =~ /\.(.*)/; $self->{network}{DOMAINNAME} ||= `/bin/dnsdomainname` and chomp $self->{network}{DOMAINNAME}; - } bless $self; } |