summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2003-02-06 17:31:08 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2003-02-06 17:31:08 +0000
commit540d81ba20862068ef040b7f98fc2cfbef597c13 (patch)
tree81cf424447cab6fc9aea269aa32899358662114b
parentd550d1e98329ed42269ccb051d7f283cbdd38ad6 (diff)
downloaddrakx-540d81ba20862068ef040b7f98fc2cfbef597c13.tar
drakx-540d81ba20862068ef040b7f98fc2cfbef597c13.tar.gz
drakx-540d81ba20862068ef040b7f98fc2cfbef597c13.tar.bz2
drakx-540d81ba20862068ef040b7f98fc2cfbef597c13.tar.xz
drakx-540d81ba20862068ef040b7f98fc2cfbef597c13.zip
avoid to mess up tmdns.conf file
-rw-r--r--perl-install/network/network.pm11
1 files changed, 4 insertions, 7 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 8172a808a..aa43b4214 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -23,8 +23,7 @@ use log;
#-######################################################################################
sub read_conf {
my ($file) = @_;
- my %netc = getVarsFromSh($file);
- \%netc;
+ { getVarsFromSh($file) }
}
sub read_resolv_conf {
@@ -77,10 +76,8 @@ sub write_conf {
}
sub write_zeroconf {
- my ($file, $netc) = @_;
- my %zeroconf_file = getVarsFromSh($file);
- $zeroconf_file{hostname} = $netc->{ZEROCONF_HOSTNAME};
- setVarsInSh($file, \%zeroconf_file);
+ my ($file, $zhostname) = @_;
+ substInFile { s/^(hostname) =.*/$1 = $zhostname/ } $file;
}
sub write_resolv_conf {
@@ -504,7 +501,7 @@ sub configureNetwork2 {
add2hosts("$etc/hosts", $netc->{HOSTNAME}, map { $_->{IPADDR} } values %$intf);
($netc->{DHCP} || grep { $_->{BOOTPROTO} =~ /^(dhcp)$/ } values %$intf) && $in->do_pkgs->install($netc->{dhcp_client} || 'dhcp-client');
- $netc->{ZEROCONF} && $in->do_pkgs->install(qw(tmdns zcip)) and write_zeroconf('/etc/tmdns.conf', $netc);
+ $netc->{ZEROCONF} && $in->do_pkgs->install(qw(tmdns zcip)) and write_zeroconf('/etc/tmdns.conf', $netc->{ZEROCONF_HOSTNAME});
any { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf and $in->do_pkgs->install('pump');
proxy_configure($::o->{miscellaneous});