Skip to content

Commit e152404

Browse files
committed
--updateversion saves updates to incorrect location #499
1 parent 8347472 commit e152404

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

mysqltuner.pl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 1.9.7
2+
# mysqltuner.pl - Version 1.9.8
33
# High Performance MySQL Tuning Script
44
# Copyright (C) 2006-2022 Major Hayden - major@mhtx.net
55
# Copyright (C) 2006-2022 Jean-Marie Renouard - jmrenouard@gmail.com
@@ -57,7 +57,7 @@ package main;
5757
#use Env;
5858

5959
# Set up a few variables for use in the script
60-
my $tunerversion = "1.9.7";
60+
my $tunerversion = "1.9.8";
6161
my ( @adjvars, @generalrec );
6262

6363
# Set defaults
@@ -594,6 +594,7 @@ sub update_tuner_version {
594594
}
595595

596596
my $update;
597+
my $fullpath="";
597598
my $url = "https://raw.githubusercontent.com/major/MySQLTuner-perl/master/";
598599
my @scripts =
599600
( "mysqltuner.pl", "basic_passwords.txt", "vulnerabilities.csv" );
@@ -606,10 +607,12 @@ sub update_tuner_version {
606607
if ( $httpcli =~ /curl$/ ) {
607608
debugprint "$httpcli is available.";
608609

610+
$fullpath=dirname(__FILE__)."/".$script;
611+
debugprint "FullPath: $fullpath"
609612
debugprint
610-
"$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $script";
613+
"$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $fullpath";
611614
$update =
612-
`$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $script`;
615+
`$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $fullpath`;
613616
chomp($update);
614617
debugprint "$script updated: $update";
615618

@@ -6872,7 +6875,7 @@ sub which {
68726875
68736876
=head1 NAME
68746877
6875-
MySQLTuner 1.9.7 - MySQL High Performance Tuning Script
6878+
MySQLTuner 1.9.8 - MySQL High Performance Tuning Script
68766879
68776880
=head1 IMPORTANT USAGE GUIDELINES
68786881

0 commit comments

Comments
 (0)