RC1 Omnishell for windows

This commit is contained in:
fbsanchez 2020-10-02 13:21:08 +02:00
parent c95855cd5d
commit da0c8355c9
4 changed files with 9 additions and 4 deletions

View File

@ -66,6 +66,10 @@ if (!defined($ConfFile) || !-e $ConfFile) {
exit 1;
}
if(!-d dirname($ConfFile).'\commands') {
mkdir(dirname($ConfFile).'\commands');
}
eval {
# Check scheduled commands
my $omnishell = new PandoraFMS::Omnishell(

View File

@ -2060,8 +2060,8 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
/* Execute omnishell commands */
omnishell_path = Pandora::getPandoraInstallDir ();
omnishell_path += "util\\omnishell_client.exe \"" + conf_file+"\"";
omnishell_path = '"'+Pandora::getPandoraInstallDir ();
omnishell_path += "util\\omnishell_client.exe\" \"" + conf_file+"\"";
if (getPandoraDebug () != false) {
pandoraLog ("Omnishell: Running");
}

View File

@ -231,6 +231,7 @@ sub new {
%{$args},
};
$self->{'temporal'} =~ s/\"|\'//g;
$self = bless($self, $class);
$self->prepare_commands();
@ -584,8 +585,8 @@ sub evaluate_command {
# [0] because how library works.
my $cmd = $self->{'commands'}->{$ref}->[0];
my $std_files = ' >> '.$self->{'temporal'}.'/'.$ref.'.stdout ';
$std_files .= ' 2>> '.$self->{'temporal'}.'/'.$ref.'.stderr ';
my $std_files = ' >> "'.$self->{'temporal'}.'/'.$ref.'.stdout" ';
$std_files .= ' 2>> "'.$self->{'temporal'}.'/'.$ref.'.stderr" ';
# Check preconditions
my $err_level;