summaryrefslogtreecommitdiffstats
path: root/perl-install/network.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network.pm')
-rw-r--r--perl-install/network.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perl-install/network.pm b/perl-install/network.pm
index 9c7c325c8..31fcd7e0f 100644
--- a/perl-install/network.pm
+++ b/perl-install/network.pm
@@ -22,6 +22,21 @@ sub read_conf {
\%netc;
}
+sub read_resolv_conf {
+ my ($file) = @_;
+ my %netc;
+ my @l;
+
+ local *F;
+ open F, $file or die "cannot open $file: $!";
+ foreach (<F>) {
+ push @l, $1 if (/^\s*nameserver\s+([^\s]+)/);
+ }
+
+ $netc{$_} = shift @l foreach qw(dnsServer dnsServer2 dnsServer3);
+ \%netc;
+}
+
sub read_interface_conf {
my ($file) = @_;
my %intf = getVarsFromSh($file) or die "cannot open file $file: $!";