summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-09-03 15:24:28 +0000
committerdamien <damien@mandriva.com>2001-09-03 15:24:28 +0000
commit9cc1d1065938fee79bcdd272af739a46da6808c7 (patch)
tree644443b802bd84a54e8b3575cbc54dd82b111e64 /perl-install
parent78bee1924597c883bcabcf183066f82dc1fe0328 (diff)
downloaddrakx-backup-do-not-use-9cc1d1065938fee79bcdd272af739a46da6808c7.tar
drakx-backup-do-not-use-9cc1d1065938fee79bcdd272af739a46da6808c7.tar.gz
drakx-backup-do-not-use-9cc1d1065938fee79bcdd272af739a46da6808c7.tar.bz2
drakx-backup-do-not-use-9cc1d1065938fee79bcdd272af739a46da6808c7.tar.xz
drakx-backup-do-not-use-9cc1d1065938fee79bcdd272af739a46da6808c7.zip
added timeout in resolv.conf
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/network.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index f843c25e7..75dcedf8d 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -91,16 +91,20 @@ sub write_resolv_conf {
my (%search, %dns, @unknown);
local *F; open F, $file;
local $_;
+ my $options;
while (<F>) {
+ if (/^[\s]*(options\s+[^#]*).*$/) { $options = $1; $options =~ s/timeout:\d+/timeout:1/; next }
/^[#\s]*search\s+(.*?)\s*$/ and $search{$1} = $., next;
/^[#\s]*nameserver\s+(.*?)\s*$/ and $dns{$1} = $., next;
/^.*# ppp temp entry\s*$/ and next;
/^[#\s]*(\S.*?)\s*$/ and push @unknown, $1;
}
+ $options ||= "options timeout:1";
close F; open F, ">$file" or die "cannot write $file: $!";
print F "# search $_\n" foreach grep { $_ ne "$netc->{DOMAINNAME} $netc->{DOMAINNAME2}" } sort { $search{$a} <=> $search{$b} } keys %search;
- print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n\n" if ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2});
+ print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n" if ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2});
+ print F "$options\n\n";
print F "# nameserver $_\n" foreach grep { ! exists $used_dns{$_} } sort { $dns{$a} <=> $dns{$b} } keys %dns;
print F "nameserver $_\n" foreach sort { $used_dns{$a} <=> $used_dns{$b} } grep { $_ } keys %used_dns;
print F "\n";