From 21aedb1e7a37df6688411cc3e62d0eb2d71523c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Sat, 27 May 2023 17:01:29 -0600 Subject: [PATCH] Print missing files and change log_file to logfile --- pandora_server/util/pandora_manage.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 71814e30f6..c4694501b8 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -5923,13 +5923,25 @@ sub cli_get_bad_conf_files() { foreach my $file (@files) { # Check important tokens my $missings = 0; - my @tokens = ("server_ip","server_path","temporal","log_file"); + my @tokens = ("server_ip","server_path","temporal","logfile"); if ($file !~ /.srv./) { foreach my $token (@tokens) { - if(enterprise_hook('pandora_check_conf_token',[$conf->{incomingdir}.'/conf/'.$file, $token]) == 0) { + my $result = enterprise_hook('pandora_check_conf_token', [$conf->{incomingdir}.'/conf/'.$file, $token]); + + if($result == 0) { $missings++; } + elsif ($result == -1) { + print_log "[WARN] File not exists /conf/".$file."\n\n"; + $bad_files++; + last; + } + elsif(!defined $result) { + print_log "[WARN] Can't open file /conf/".$file."\n\n"; + $bad_files++; + last; + } } # If any token of checked is missed we print the file path