summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2000-09-07 16:43:32 +0000
committerdamien <damien@mandriva.com>2000-09-07 16:43:32 +0000
commit241ac866dc8d3d872aa7848eb0d56eb57cf82233 (patch)
treeeceaee6b940d6861516a41e40b3d58ec796a63f2
parent412cc80224817af6d2b9374c0e1cb369c089a12e (diff)
downloaddrakx-241ac866dc8d3d872aa7848eb0d56eb57cf82233.tar
drakx-241ac866dc8d3d872aa7848eb0d56eb57cf82233.tar.gz
drakx-241ac866dc8d3d872aa7848eb0d56eb57cf82233.tar.bz2
drakx-241ac866dc8d3d872aa7848eb0d56eb57cf82233.tar.xz
drakx-241ac866dc8d3d872aa7848eb0d56eb57cf82233.zip
updated
-rw-r--r--perl-install/network.pm13
-rwxr-xr-xperl-install/standalone/draknet2
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;