summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/network.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 60d103217..9649917fc 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -52,6 +52,18 @@ sub read_interface_conf {
\%intf;
}
+sub read_dhcpd_conf {
+ my ($file) = @_;
+ $file ||= "$::prefix/etc/dhcpd.conf";
+ { option_routers => [ cat_($file) =~ /^\s*option routers\s+(\S+)\;/mg ],
+ subnet_mask => [ if_(cat_($file) =~ /^\s*option subnet-mask\s+(.*)\;/mg, split(' ', $1)) ],
+ domain_name => [ if_(cat_($file) =~ /^\s*option domain-name\s+\"(.*)\"\;/mg, split(' ', $1)) ],
+ domain_name_servers => [ if_(cat_($file) =~ /^\s*option domain-name-servers\s+(.*)\;/m, split(' ', $1)) ],
+ dynamic_bootp => [ if_(cat_($file) =~ /^\s*range dynamic-bootp\s+\S+\.(\d+)\s+\S+\.(\d+)\s*\;/m, split(' ', $1)) ],
+ default_lease_time => [ if_(cat_($file) =~ /^\s*default-lease-time\s+(.*)\;/m, split(' ', $1)) ],
+ max_lease_time => [ if_(cat_($file) =~ /^\s*max-lease-time\s+(.*)\;/m, split(' ', $1)) ] };
+}
+
sub read_tmdns_conf {
my ($file) = @_;
local *F; open F, $file or die "cannot open file $file: $!";