diff options
author | Antoine Ginies <aginies@mandriva.com> | 2006-06-21 10:22:46 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2006-06-21 10:22:46 +0000 |
commit | 41d0a26437dd06eb5e15d84299831507b000078e (patch) | |
tree | 947eee7bfe15a5431a14113ea21f2c06dbc186d7 /nfs_wizard | |
parent | 02da6659361e7e1b8469b535d0245daf05df01a0 (diff) | |
download | drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar.gz drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar.bz2 drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar.xz drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.zip |
fix ask_warn for nisautofs wizard
Diffstat (limited to 'nfs_wizard')
-rwxr-xr-x | nfs_wizard/NFS.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/nfs_wizard/NFS.pm b/nfs_wizard/NFS.pm index 4b19dd9e..eedf6259 100755 --- a/nfs_wizard/NFS.pm +++ b/nfs_wizard/NFS.pm @@ -52,21 +52,23 @@ $o->{pages} = { name => N("NFS Server Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the NFS server for your network."), no_back => 1, pre => sub { - $in->ask_warn((""), N("You should now use draknfs to configure your NFS share.")); + $in->ask_warn((""), N("You should now use draknfs to configure your NFS share.")) or $in->exit; }, next => 'nfs' }, nfs => { name => N("NFS server") . "\n\n" .N("Directory which will be exported to NFS clients. This directory will be exported in read only mode. It denies any request which requires changes to the filesystem."), data => [ - { label => N("Directory:"), val => \$o->{var}{wiz_nfs_dir} }, + { label => N("Directory:"), val => \$o->{var}{wiz_nfs_dir} }, + { label => N("Create directory if it doesn't exist"), type => 'bool', val => \$o->{var}{create_missing_directory} }, ], complete => sub { - if (! -d $o->{var}{wiz_nfs_dir}) { - $in->ask_warn(N("Error"), N("The path you entered does not exist.")); - return 1; - } - }, + if (!-d $o->{var}{wiz_nfs_dir} and $o->{var}{create_missing_directory}) { + mkdir_p($o->{var}{wiz_nfs_dir}); + } elsif (!-d $o->{var}{wiz_nfs_dir}) { + $in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually.")); + return 1; } + }, next => 'ask_level' }, ask_level => { |