diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 2168dd72d7..0bd2223708 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1298,13 +1298,14 @@ sub check_collections () { # Read local md5 my $local_collection_md5 = ''; - if (defined (open (MD5_FILE, "< $ConfDir/collections/$collection_md5_file"))) { - $local_collection_md5 = ; - close MD5_FILE; - } - else{ - log_message ('Collection', "Could not open dir $ConfDir/collections/$collection_md5_file"); - next; + if (-f "$ConfDir/collections/$collection_md5_file") { + if (open (MD5_FILE, "< $ConfDir/collections/$collection_md5_file")) { + $local_collection_md5 = ; + close MD5_FILE; + } else { + log_message ('Collection', "Could not open dir $ConfDir/collections/$collection_md5_file"); + next; + } } # Check for changes @@ -1312,7 +1313,7 @@ sub check_collections () { next if ($local_collection_md5 eq $remote_collection_md5); # Download and unzip - if(recv_file ($collection_md5_file, $Conf{'server_path_md5'}) != 0){ + if (recv_file ($collection_file, $Conf{'server_path_zip'}) != 0) { log_message ('Collection', "Could not write $collection_file on " . $Conf{'server_path_zip'}); next; }