From 7c3fe363be7f427ce33b12186c1b961cc00998ec Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 13 Aug 2004 02:05:32 +0000 Subject: (write_interface_conf) do not write undefined MAC address in iftab --- perl-install/network/network.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'perl-install/network/network.pm') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 44e665ad3..146619e07 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -144,8 +144,8 @@ sub write_interface_conf { my ($mac_address) = `LC_ALL= LANG= $::prefix/sbin/ip -o link show $intf->{DEVICE} 2>/dev/null` =~ m|.*link/ether\s([0-9a-z:]+)\s|; $intf->{HWADDR} &&= $mac_address; #- set HWADDR to MAC address if required - #- write interface MAC address in iftab - substInFile { s/^$intf->{DEVICE}\s+.*\n//; $_ .= qq($intf->{DEVICE}\t$mac_address\n) if eof } "$::prefix/etc/iftab"; + #- write interface MAC address in iftab (if any) + substInFile { s/^$intf->{DEVICE}\s+.*\n//; $_ .= qq($intf->{DEVICE}\t$mac_address\n) if eof } "$::prefix/etc/iftab" if $mac_address; my @ip = split '\.', $intf->{IPADDR}; my @mask = split '\.', $intf->{NETMASK}; -- cgit v1.2.1