From f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 23 Aug 2004 03:46:48 +0000 Subject: (add2hosts) make it work with sub hostnames --- perl-install/network/network.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 29c4922cf..058a0679c 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -171,10 +171,10 @@ sub write_interface_conf { sub add2hosts { my ($file, $hostname, @ips) = @_; + my $sub_hostname = $hostname =~ /(.*?)\./ ? " $1" : ''; my %l = map { if_(/\s*(\S+)(.*)/, $1 => $2) } - grep { !/\s+\Q$hostname\E\s*$/ } cat_($file); + grep { !/\s+\Q$hostname$sub_hostname\E\s*$/ } cat_($file); - my $sub_hostname = $hostname =~ /(.*?)\./ ? " $1" : ''; $l{$_} = "\t\t$hostname$sub_hostname" foreach grep { $_ } @ips; log::explanations("writing host information to $file"); -- cgit v1.2.1