Merge pull request #346 from tompmeyer/find_real_error_log_path
Determine real log_error path.
This commit is contained in:
commit
e316b9ac21
1 changed files with 19 additions and 0 deletions
|
@ -1148,7 +1148,26 @@ sub get_basic_passwords {
|
||||||
return get_file_contents(shift);
|
return get_file_contents(shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_log_file_real_path {
|
||||||
|
my $file = shift;
|
||||||
|
my $hostname = shift;
|
||||||
|
my $datadir = shift;
|
||||||
|
if ( -f "$file" ) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
elsif ( -f "$hostname.err" ) {
|
||||||
|
return "$hostname.err"
|
||||||
|
}
|
||||||
|
elsif ( $datadir ne "" ) {
|
||||||
|
return "$datadir$hostname.err";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub log_file_recommandations {
|
sub log_file_recommandations {
|
||||||
|
$myvar{'log_error'} = get_log_file_real_path( $myvar{'log_error'}, $myvar{'hostname'}, $myvar{'datadir'} );
|
||||||
subheaderprint "Log file Recommendations";
|
subheaderprint "Log file Recommendations";
|
||||||
infoprint "Log file: "
|
infoprint "Log file: "
|
||||||
. $myvar{'log_error'} . "("
|
. $myvar{'log_error'} . "("
|
||||||
|
|
Loading…
Reference in a new issue