diff options
author | Florent Villard <warly@mandriva.com> | 2003-09-15 11:10:22 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2003-09-15 11:10:22 +0000 |
commit | 724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7 (patch) | |
tree | 2e796bb5e0cb5fb582b6f48563696337b6bea18d /client_wizard | |
parent | 5cbe71386657f4f045cbd59137f5e1d702a93292 (diff) | |
download | drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar.gz drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar.bz2 drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar.xz drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.zip |
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
Diffstat (limited to 'client_wizard')
-rwxr-xr-x | client_wizard/Bind_client.pm | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/client_wizard/Bind_client.pm b/client_wizard/Bind_client.pm index fc7996f3..799d38f7 100755 --- a/client_wizard/Bind_client.pm +++ b/client_wizard/Bind_client.pm @@ -24,6 +24,8 @@ use lib qw(/usr/lib/libDrakX); use strict; use common; +use services; +use MDK::Wizard::Varspaceval; use MDK::Wizard::Wizcommon; my $wiz = new MDK::Wizard::Wizcommon; @@ -32,7 +34,7 @@ my $wiz_domain_name = $wiz->{net}->network_get("DOMAINNAME"); my $o = { name => N('DNS Client Wizard'), - var => { + var => { client_ip => '', client_name => '' }, @@ -53,7 +55,6 @@ $o->{pages} = { $o->{var}{client_ip} = ip(); $o->{var}{client_name} = name(); }, - post => \&check, data => [ { label => N('Name of the machine:'), val => \$o->{var}{client_name} }, { label => N('IP number of the machine:'), val => \$o->{var}{client_ip} }, @@ -107,7 +108,7 @@ sub ip { sub get_root { my $file = "/etc/sysconfig/named"; if (-f $file) { - my %mdk = Vareqval->get($file); + my %mdk = MDK::Wizard::Varspaceval->get($file); return $mdk{ROOTDIR}; } ""; @@ -135,12 +136,12 @@ sub up_serial { } sub test { - !$o->{client_name} and return 1; - !$o->{client_ip} and return 1; + !$o->{client_name} and return 'error'; + !$o->{client_ip} and return 'error'; my $s_trunc = "$1.$2.$3" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; my $ds = "$4" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; - my $dc = "$4" if $ENV{wiz_client_ip} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; - my $sc_trunc = "$1.$2.$3" if $ENV{wiz_client_ip} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; + my $dc = "$4" if $o->{var}{client_ip} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; + my $sc_trunc = "$1.$2.$3" if $o->{var}{client_ip} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; (!$sc_trunc || !$dc || !$ds || !$s_trunc || ($s_trunc != $sc_trunc) || ($dc == $ds || $dc < 0 || $dc > 255)) and return 'error'; } @@ -151,22 +152,26 @@ 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 $s_trunc = "$1.$2.$3" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; my $ds = "$4" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; - my $dc = "$4" if $ENV{wiz_client_ip} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; + my $dc = "$4" if $o->{var}{client_ip} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; my $file="/var/named/$wiz_domain_name.db"; MDK::Common::cp_af($file, $file.".orig"); open(NEW, ">> $file") or die "can not open $file"; - print NEW "\n$ENV{wiz_client_name} IN A $ENV{wiz_client_ip} ; $date"; + print NEW "\n$o->{var}{client_name} IN A $o->{var}{client_ip} ; $date\n\n"; close(NEW) or die "can not close $file"; up_serial($file); my $file="/var/named/$s_trunc.rev"; MDK::Common::cp_af($file, $file.".orig"); open(NEW, ">> $file") or die "can not open $file"; - print NEW "\n$dc IN PTR $ENV{wiz_client_name}. ; $date"; + print NEW "\n$dc IN PTR $o->{var}{client_name}. ; $date\n\n"; close(NEW) or die "can not close $file"; up_serial($file); - system("/etc/rc.d/init.d/named restart"); + if (services::is_service_running('named')) { + services::restart('named') + } else { + services::start('named') + } } sub new { |