From 241ac866dc8d3d872aa7848eb0d56eb57cf82233 Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 7 Sep 2000 16:43:32 +0000 Subject: updated --- perl-install/network.pm | 13 +++++++------ perl-install/standalone/draknet | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/perl-install/network.pm b/perl-install/network.pm index 51d094e46..c9eaaf9ba 100644 --- a/perl-install/network.pm +++ b/perl-install/network.pm @@ -84,13 +84,14 @@ sub write_resolv_conf { log::l("neither domain name nor dns server are configured"); return 0; } - my @l = cat_($file); - local *F; - open F, "> $file" or die "cannot write $file: $!"; - print F "search $netc->{DOMAINNAME}\n" if $netc->{DOMAINNAME}; - print F "nameserver $_\n" foreach dnsServers($netc); - print F "#$_" foreach @l; + substInFile { + s/^([^#].*\n)/\#$1/; + if (eof) { + $_ .= "search $netc->{DOMAINNAME}\n" if $netc->{DOMAINNAME}; + $_ .= "nameserver $_\n" foreach dnsServers($netc); + } + } $file; #-res_init(); # reinit the resolver so DNS changes take affect 1; diff --git a/perl-install/standalone/draknet b/perl-install/standalone/draknet index e11970896..f3dbdcdf4 100755 --- a/perl-install/standalone/draknet +++ b/perl-install/standalone/draknet @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -use lib qw (/usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use interactive; use netconnect; -- cgit v1.2.1