summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-23 03:46:48 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-23 03:46:48 +0000
commitf3f28f6bdf5f58ec94eba5ba83b03fa2dea63471 (patch)
treeadc6a8f1a1e3fb24436c1d5b9991bfbac3c1fc26
parent68ca1ca88c110fda65773a26ae18bfb9e216b08c (diff)
downloaddrakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar
drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar.gz
drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar.bz2
drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar.xz
drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.zip
(add2hosts) make it work with sub hostnames
-rw-r--r--perl-install/network/network.pm4
1 files 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");