Use https instead of http #317
typo, space missing before is #315
This commit is contained in:
root 2017-04-21 00:13:45 +02:00
parent 36abf64b64
commit 21af94158d

View file

@ -1,7 +1,7 @@
#!/usr/bin/env perl #!/usr/bin/env perl
# mysqltuner.pl - Version 1.7.1 # mysqltuner.pl - Version 1.7.1
# High Performance MySQL Tuning Script # High Performance MySQL Tuning Script
# Copyright (C) 2006-2016 Major Hayden - major@mhtx.net # Copyright (C) 2006-2017 Major Hayden - major@mhtx.net
# #
# For the latest updates, please visit http://mysqltuner.com/ # For the latest updates, please visit http://mysqltuner.com/
# Git repository available at http://github.com/major/MySQLTuner-perl # Git repository available at http://github.com/major/MySQLTuner-perl
@ -537,16 +537,15 @@ sub validate_tuner_version {
} }
my $update; my $update;
my $url = my $url = "https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl";
"https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl";
my $httpcli = get_http_cli(); my $httpcli = get_http_cli();
if ( $httpcli =~ /curl$/ ) { if ( $httpcli =~ /curl$/ ) {
debugprint "$httpcli is available."; debugprint "$httpcli is available.";
debugprint debugprint
"$httpcli --connect-timeout 5 -silent '$url' 2>/dev/null | grep 'my \$tunerversion'| cut -d\\\" -f2"; "$httpcli -m 3 -silent '$url' 2>/dev/null | grep 'my \$tunerversion'| cut -d\\\" -f2";
$update = $update =
`$httpcli --connect-timeout 5 -silent '$url' 2>/dev/null | grep 'my \$tunerversion'| cut -d\\\" -f2`; `$httpcli -m 3 -silent '$url' 2>/dev/null | grep 'my \$tunerversion'| cut -d\\\" -f2`;
chomp($update); chomp($update);
debugprint "VERSION: $update"; debugprint "VERSION: $update";
@ -558,9 +557,9 @@ sub validate_tuner_version {
debugprint "$httpcli is available."; debugprint "$httpcli is available.";
debugprint debugprint
"$httpcli -e timestamping=off -t 1 -T 5 -O - '$url' 2>$devnull| grep 'my \$tunerversion'| cut -d\\\" -f2"; "$httpcli -e timestamping=off -t 1 -T 3 -O - '$url' 2>$devnull| grep 'my \$tunerversion'| cut -d\\\" -f2";
$update = $update =
`$httpcli -e timestamping=off -t 1 -T 5 -O - '$url' 2>$devnull| grep 'my \$tunerversion'| cut -d\\\" -f2`; `$httpcli -e timestamping=off -t 1 -T 3 -O - '$url' 2>$devnull| grep 'my \$tunerversion'| cut -d\\\" -f2`;
chomp($update); chomp($update);
compare_tuner_version($update); compare_tuner_version($update);
return; return;
@ -580,7 +579,6 @@ sub update_tuner_version {
return; return;
} }
#use Cwd;
my $update; my $update;
my $url = "https://raw.githubusercontent.com/major/MySQLTuner-perl/master/"; my $url = "https://raw.githubusercontent.com/major/MySQLTuner-perl/master/";
my @scripts = my @scripts =
@ -595,9 +593,9 @@ sub update_tuner_version {
debugprint "$httpcli is available."; debugprint "$httpcli is available.";
debugprint debugprint
"$httpcli --connect-timeout 5 '$url$script' 2>$devnull > $script"; "$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $script";
$update = $update =
`$httpcli --connect-timeout 5 '$url$script' 2>$devnull > $script`; `$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $script`;
chomp($update); chomp($update);
debugprint "$script updated: $update"; debugprint "$script updated: $update";
@ -614,9 +612,9 @@ sub update_tuner_version {
debugprint "$httpcli is available."; debugprint "$httpcli is available.";
debugprint debugprint
"$httpcli -qe timestamping=off -T 5 -O $script '$url$script'"; "$httpcli -qe timestamping=off -t 1 -T 3 -O $script '$url$script'";
$update = $update =
`$httpcli -qe timestamping=off -T 5 -O $script '$url$script'`; `$httpcli -qe timestamping=off -t 1 -T 3 -O $script '$url$script'`;
chomp($update); chomp($update);
if ( -s $script eq 0 ) { if ( -s $script eq 0 ) {
@ -1541,11 +1539,11 @@ sub get_system_info {
my $ext_ip = ""; my $ext_ip = "";
if ( $httpcli =~ /curl$/ ) { if ( $httpcli =~ /curl$/ ) {
$ext_ip = infocmd_one "$httpcli ipecho.net/plain"; $ext_ip = infocmd_one "$httpcli -m 3 ipecho.net/plain";
} }
elsif ( $httpcli =~ /wget$/ ) { elsif ( $httpcli =~ /wget$/ ) {
$ext_ip = infocmd_one "$httpcli -q -O - ipecho.net/plain"; $ext_ip = infocmd_one "$httpcli -t 1 -T 3 -q -O - ipecho.net/plain";
} }
infoprint "External IP : " . $ext_ip; infoprint "External IP : " . $ext_ip;
$result{'Network'}{'External Ip'} = $ext_ip; $result{'Network'}{'External Ip'} = $ext_ip;
@ -2149,7 +2147,7 @@ sub check_storage_engines {
$data_free = $data_free / 1024 / 1024; $data_free = $data_free / 1024 / 1024;
$total_free += $data_free; $total_free += $data_free;
push( @generalrec, push( @generalrec,
" OPTIMIZE TABLE $table_name; -- can free $data_free MB" ); " OPTIMIZE TABLE `$table_name`; -- can free $data_free MB" );
} }
push( @generalrec, push( @generalrec,
"Total freed space after theses OPTIMIZE TABLE : $total_free Mb" ); "Total freed space after theses OPTIMIZE TABLE : $total_free Mb" );