summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorFlorin Grad <florin@mandriva.com>2003-02-27 10:07:24 +0000
committerFlorin Grad <florin@mandriva.com>2003-02-27 10:07:24 +0000
commit0418cc0625cfff05b1f1c212af20a65d1f596677 (patch)
tree594250d99f18835e3ff068991d1a9992e058293c /perl-install/network
parent50d34dc3cdd2597e6775a53a8a45e20f38c16906 (diff)
downloaddrakx-backup-do-not-use-0418cc0625cfff05b1f1c212af20a65d1f596677.tar
drakx-backup-do-not-use-0418cc0625cfff05b1f1c212af20a65d1f596677.tar.gz
drakx-backup-do-not-use-0418cc0625cfff05b1f1c212af20a65d1f596677.tar.bz2
drakx-backup-do-not-use-0418cc0625cfff05b1f1c212af20a65d1f596677.tar.xz
drakx-backup-do-not-use-0418cc0625cfff05b1f1c212af20a65d1f596677.zip
add the read_dhcpd_conf function for drakgw
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: $!";