mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Add check if server is installed
This commit is contained in:
@@ -5,6 +5,22 @@ BEGIN { push(@INC, ".."); };
|
||||
use WebminCore;
|
||||
&init_config();
|
||||
|
||||
# check_exports()
|
||||
# Returns an error message if the NFS exports package is missing
|
||||
sub check_exports
|
||||
{
|
||||
if ($gconfig{'os_type'} eq 'freebsd') {
|
||||
foreach my $c ("mountd", "nfsd", "portmap") {
|
||||
&has_command($c) || return &text('check_ecmd', $c);
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
else {
|
||||
# Don't know
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
# list_exports()
|
||||
# Returns the current exports list
|
||||
sub list_exports
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
require './bsdexports-lib.pl';
|
||||
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
|
||||
|
||||
# Check if installed
|
||||
my $err = &check_exports();
|
||||
if ($err) {
|
||||
print "<b>",&text('index_echeck', $err),"</b><p>\n";
|
||||
&ui_print_footer("/", $text{'index'});
|
||||
return;
|
||||
}
|
||||
|
||||
@exp = &list_exports();
|
||||
if (@exp) {
|
||||
print &ui_form_start("delete_exports.cgi", "post");
|
||||
|
||||
14
bsdexports/install_check.pl
Executable file
14
bsdexports/install_check.pl
Executable file
@@ -0,0 +1,14 @@
|
||||
# install_check.pl
|
||||
|
||||
do 'bsdexports-lib.pl';
|
||||
|
||||
# is_installed(mode)
|
||||
# For mode 1, returns 2 if the server is installed and configured for use by
|
||||
# Webmin, 1 if installed but not configured, or 0 otherwise.
|
||||
# For mode 0, returns 1 if installed, 0 if not
|
||||
sub is_installed
|
||||
{
|
||||
return 0 if (&check_exports());
|
||||
return $_[0] ? 2 : 1;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ index_delete=Delete Selected Exports
|
||||
index_apply=Apply Changes
|
||||
index_applydesc=Click this button to apply the current file exports configuration. This will make all the directories listed above available with the options specified.
|
||||
index_return=exports list
|
||||
index_echeck=The NFS server cannot be used on this system : $1
|
||||
|
||||
check_ecmd=NFS server command $1 is not installed
|
||||
|
||||
delete_err=Failed to delete exports
|
||||
delete_enone=None selected
|
||||
|
||||
Reference in New Issue
Block a user