From 724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Mon, 15 Sep 2003 11:10:22 +0000 Subject: fix apache fix dns_client adding a \n at the end of the line of the configuration file fix squid fix inn fix ftp fix samba add a init function in drakwizard.pl for case such as apache which need to initialize some parameters separate region/country in ntp wizard --- dhcp_wizard/Dhcp.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'dhcp_wizard/Dhcp.pm') diff --git a/dhcp_wizard/Dhcp.pm b/dhcp_wizard/Dhcp.pm index b8168450..6aa67a38 100755 --- a/dhcp_wizard/Dhcp.pm +++ b/dhcp_wizard/Dhcp.pm @@ -23,6 +23,8 @@ package MDK::Wizard::Dhcp; use strict; use common; +use MDK::Wizard::Varspaceval; +use services; use MDK::Wizard::Wizcommon; my $wiz = new MDK::Wizard::Wizcommon; @@ -159,7 +161,7 @@ sub do_it { } my $wiz_ip_net = "$1.$2.$3.0" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; my $err = check(); - return $err if $err != 10; + return $err if $err != 0; my $wiz_ip_range1 = $o->{var}{ip1}; my $wiz_ip_range2 = $o->{var}{ip2}; my $wiz_ip_netmask = $wiz->{net}->itf_get("NETMASK"); @@ -208,18 +210,21 @@ mask = $wiz_ip_netmask, rng1 = $wiz_ip_range1, rng2 = $wiz_ip_range2, dname = $w # modifying webmin config $file="/etc/webmin/dhcpd/config"; if (-f $file) { - my %mdk = Vareqval->get($file); + my %mdk = MDK::Wizard::Varspaceval->get($file); $mdk{lease_file} = "/var/dhcpd/dhcpd.leases"; $mdk{interfaces} = $wiz_device; standalone::explanations("$file: lease_file = $mdk{lease_file}, interfaces = $mdk{interfaces}"); - Vareqval->commit($file, \%mdk); + MDK::Wizard::Varspaceval->commit($file, \%mdk); !$ENV{wiz_authoritative} and output($file, map { s|^\s*not\s*authoritative.*|\#$&|i; $_ } cat_ ("/etc/dhcpd.conf")); } - - system("/etc/rc.d/init.d/dhcpd restart"); + if (services::is_service_running('dhcpd')) { + services::restart('dhcpd') + } else { + services::start('dhcpd') + } 10; } -- cgit v1.2.1