diff --git a/minecraft/index.cgi b/minecraft/index.cgi
index da42fdd48..3541b34e3 100755
--- a/minecraft/index.cgi
+++ b/minecraft/index.cgi
@@ -4,11 +4,17 @@
use strict;
use warnings;
require './minecraft-lib.pl';
-our (%in, %text, %config, $module_name);
+our (%in, %text, %config, $module_name, $module_root_directory);
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
&help_search_link("minecraft", "google"));
+# Check for sane root dir
+if ($config{'minecraft_dir'} eq $module_root_directory) {
+ &ui_print_endpage(&text('index_rooterr', $module_root_directory,
+ "../config.cgi?$module_name"));
+ }
+
my $err = &check_minecraft_server();
if ($err && &is_minecraft_port_in_use()) {
# Not found, but server appears to be running
diff --git a/minecraft/lang/en b/minecraft/lang/en
index e4a7e2839..5283d12b8 100644
--- a/minecraft/lang/en
+++ b/minecraft/lang/en
@@ -1,6 +1,7 @@
index_title=Minecraft Server
index_cerr=An error was detected with your Minecraft server : $1. You may need to adjust the module configuration.
index_cerr2=The Minecraft server does not appear to be installed on your system. If it is already running, you will need to adjust the module configuration to use the correct paths.
+index_rooterr=The Minecraft root directory is set on the module configuration page to $2, but this is the same as the Webmin module directory!
index_nojava=Also, the Java command $1 needed to run Minecraft was not found.
index_offer=Alternatively, Webmin can automatically download and install the Minecraft server for you.
index_dir=Install into directory