From 74752c92d4ccc1fc226cb4aa7ff0fa96d8d29b5a Mon Sep 17 00:00:00 2001 From: damien Date: Mon, 27 Aug 2001 13:14:32 +0000 Subject: added HWADDR --- perl-install/network/network.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'perl-install/network') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 40f2e6053..98c3e285b 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -117,12 +117,15 @@ sub write_interface_conf { my @ip = split '\.', $intf->{IPADDR}; my @mask = split '\.', $intf->{NETMASK}; + my $hwaddr = -e $prefix/sbin/ip ? `LC_ALL= LANG= $prefix/sbin/ip -o link show $intf` : undef; + if ($hwaddr) { chomp $hwaddr; $hwaddr =~ s/.*link\/ether\s([0-9a-z:]+)\s.*/$1/; } add2hash($intf, { BROADCAST => join('.', mapn { int $_[0] | ~int $_[1] & 255 } \@ip, \@mask), NETWORK => join('.', mapn { int $_[0] & $_[1] } \@ip, \@mask), ONBOOT => bool2yesno(!member($intf->{DEVICE}, map { $_->{device} } detect_devices::probeall())), + HWADDR => $hwaddr }); - setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT), ($intf->{wireless_eth}) ? qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV) : ()); + setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR), ($intf->{wireless_eth}) ? qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV) : ()); } sub add2hosts { -- cgit v1.2.1