From 6bc41c18be44b8a6d8abf8cbc40be9af2c31e9aa Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 9 Aug 2004 02:57:49 +0000 Subject: perl_checker compliance + cleanup --- perl-install/network/network.pm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 06e86155c..83e6d15a4 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -53,23 +53,23 @@ sub read_interface_conf { } 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)) ] }; + my ($o_file) = @_; + my $s = cat_($o_file || "$::prefix/etc/dhcpd.conf"); + { option_routers => [ $s =~ /^\s*option routers\s+(\S+);/mg ], + subnet_mask => [ if_($s =~ /^\s*option subnet-mask\s+(.*);/mg, split(' ', $1)) ], + domain_name => [ if_($s =~ /^\s*option domain-name\s+"(.*)";/mg, split(' ', $1)) ], + domain_name_servers => [ if_($s =~ /^\s*option domain-name-servers\s+(.*);/m, split(' ', $1)) ], + dynamic_bootp => [ if_($s =~ /^\s*range dynamic-bootp\s+\S+\.(\d+)\s+\S+\.(\d+)\s*;/m, split(' ', $1)) ], + default_lease_time => [ if_($s =~ /^\s*default-lease-time\s+(.*);/m, split(' ', $1)) ], + max_lease_time => [ if_($s =~ /^\s*max-lease-time\s+(.*);/m, split(' ', $1)) ] }; } sub read_squid_conf { - my ($file) = @_; - $file ||= "$::prefix/etc/squid/squid.conf"; - { http_port => [ cat_($file) =~ /^\s*http_port\s+(.*)/mg ], - cache_size => [ if_(cat_($file) =~ /^\s*cache_dir diskd\s+(.*)/mg, split(' ', $1)) ], - admin_mail => [ if_(cat_($file) =~ /^\s*err_html_text\s+(.*)/mg, split(' ', $1)) ] }; + my ($o_file) = @_; + my $s = cat_($o_file || "$::prefix/etc/squid/squid.conf"); + { http_port => [ $s =~ /^\s*http_port\s+(.*)/mg ], + cache_size => [ if_($s =~ /^\s*cache_dir diskd\s+(.*)/mg, split(' ', $1)) ], + admin_mail => [ if_($s =~ /^\s*err_html_text\s+(.*)/mg, split(' ', $1)) ] }; } sub read_tmdns_conf() { -- cgit v1.2.1