diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-08-23 03:46:48 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-08-23 03:46:48 +0000 |
commit | f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471 (patch) | |
tree | adc6a8f1a1e3fb24436c1d5b9991bfbac3c1fc26 /perl-install/network | |
parent | 68ca1ca88c110fda65773a26ae18bfb9e216b08c (diff) | |
download | drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar.gz drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar.bz2 drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.tar.xz drakx-f3f28f6bdf5f58ec94eba5ba83b03fa2dea63471.zip |
(add2hosts) make it work with sub hostnames
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/network.pm | 4 |
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"); |