mirror of
https://github.com/webmin/webmin.git
synced 2026-06-21 20:00:26 +01:00
better error checking
This commit is contained in:
@@ -35,6 +35,7 @@ if ($in{'new'} && !-d $config{'minecraft_dir'}) {
|
||||
# Download to temp file
|
||||
my $temp = &transname();
|
||||
$progress_callback_url = &get_server_jar_url();
|
||||
$progress_callback_url || &error($text{'download_eurl'});
|
||||
my ($host, $port, $page, $ssl) = &parse_http_url($progress_callback_url);
|
||||
&http_download($host, $port, $page, $temp, undef, \&progress_callback, $ssl);
|
||||
|
||||
|
||||
@@ -263,6 +263,7 @@ download_emkdir=Directory creation failed!
|
||||
download_err=Failed to setup Minecraft server
|
||||
download_edir=Missing or non-absolute install directory
|
||||
download_euser=User to run as does not exist
|
||||
download_eurl=Failed to get server download URL
|
||||
|
||||
backup_title=Scheduled Backup
|
||||
backup_header=Options for scheduled world backup
|
||||
|
||||
@@ -11,7 +11,7 @@ our ($module_root_directory, %text, %gconfig, $root_directory, %config,
|
||||
$module_name, $remote_user, $base_remote_user, $gpgpath,
|
||||
$module_config_directory, @lang_order_list, @root_directories);
|
||||
our $history_file = "$module_config_directory/history.txt";
|
||||
our $download_page_url = "https://minecraft.net/download";
|
||||
our $download_page_url = "http://minecraft.net/download";
|
||||
our $playtime_dir = "$module_config_directory/playtime";
|
||||
|
||||
&foreign_require("webmin");
|
||||
@@ -584,7 +584,7 @@ my ($host, $port, $page, $ssl) = &parse_http_url($download_page_url);
|
||||
return undef if (!$host);
|
||||
my ($out, $err);
|
||||
&http_download($host, $port, $page, \$out, \$err, undef, $ssl);
|
||||
return undef if (!$err);
|
||||
return undef if ($err);
|
||||
$out =~ /"((http|https):[^"]+minecraft_server[^"]+\.jar)"/ || return undef;
|
||||
return $1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user