diff options
-rw-r--r-- | nisautofs_wizard/Nisautofs.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/nisautofs_wizard/Nisautofs.pm b/nisautofs_wizard/Nisautofs.pm index 07474667..b85a628c 100644 --- a/nisautofs_wizard/Nisautofs.pm +++ b/nisautofs_wizard/Nisautofs.pm @@ -1,9 +1,9 @@ #/usr/bin/perl -w # version 0.3 # -# Copyright (C) 2002,2003 Mandrakesoft +# Copyright (C) 2002,2005 Mandrakesoft # -# Author: aginies _at_ mandrakesoft.com +# Author: aginies _at_ mandriva.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -56,6 +56,7 @@ my $o = { NFSEXPORTS => $NFSEXPORTS, AUTOMASTER => $AUTOMASTER, AUTOHOME => $AUTOHOME, + create_missing_directory => '', }, needed_rpm => [ 'ypserv', 'ypbind', 'nfs-utils', 'yp-tools', 'nfs-utils-clients' ], defaultimage => "$ENV{__WIZ_HOME__}/nisautofs_wizard/images/nisautofs.png", @@ -71,13 +72,21 @@ $o->{pages} = { next => 'nis_server', }, nis_server => { - name => N("NIS server with autofs map") . "\n\n" . N("A NIS server is useful to create user, hostname database. The wizard builds autofs map, so it will provide the capabilities for NIS user to automount their home directory on a NIS client computer.") . "\n\n" . N("NIS server: name of your computer.") . "\n" . N("Home NIS: home base directory for users on NIS server. This directory will be exported through NFS server.") . "\n" . N("NIS domain: NIS domain to use (generally same as your DNS domain name)."), + name => N("NIS server with autofs map") . "\n" . N("A NIS server is useful to create user, hostname database. The wizard builds autofs map, so it will provide the capabilities for NIS user to automount their home directory on a NIS client computer.") . "\n\n" . N("NIS server: name of your computer.") . "\n" . N("Home NIS: home base directory for users on NIS server. This directory will be exported through NFS server.") . "\n" . N("NIS domain: NIS domain to use (generally same as your DNS domain name)."), data => [ { label => N("NIS server:"), val => $HOST }, { label => N("Home NIS:"), val => \$o->{var}{HOMENIS} }, { label => N("NIS domainname:"), val => \$o->{var}{NISDOMAIN} }, + { text => N("Create home NIS directory if it doesn't exist"), type => 'bool', val => \$o->{var}{create_missing_directory} }, ], - post => \&test_set, + complete => sub { + if (!-d $o->{var}{HOMENIS} and $o->{var}{create_missing_directory}) { + mkdir_p($o->{var}{HOMENIS}); + } elsif (!-d $o->{var}{HOMENIS}) { + $::in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually.")); + return 0; + } + }, next => 'summaryserver', }, summaryserver => { @@ -95,10 +104,6 @@ $o->{pages} = { post => \&do_it_server, next => 'endserver', }, - error_homedir => { - name => N("Error: should be a directory."), - next => 'nis_server', - }, error_nisd => { name => N("Error: nisdomainname should not be 'none' or 'localdomain'.") . "\n\n" . N("Please adjust it."), end => 1, |