From 540d81ba20862068ef040b7f98fc2cfbef597c13 Mon Sep 17 00:00:00 2001 From: Damien Chaumette Date: Thu, 6 Feb 2003 17:31:08 +0000 Subject: avoid to mess up tmdns.conf file --- perl-install/network/network.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'perl-install/network/network.pm') 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}); -- cgit v1.2.1