* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2015 Marcin Haba
+ * Copyright (C) 2013-2016 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
const SUDO = 'sudo';
- const BCONSOLE_COMMAND_PATTERN = "%s%s -c %s %s <<END_OF_DATA\n%s\nquit\n<<END_OF_DATA";
+ const BCONSOLE_COMMAND_PATTERN = "%s%s -c %s %s <<END_OF_DATA\n%s\nquit\nEND_OF_DATA";
const BCONSOLE_DIRECTORS_PATTERN = "%s%s -c %s -l";
}
}
$output = count($output) > 1 ? array_values($output) : array_shift($output);
- return (object)array('output' => $output, 'exitcode' => $exitcode);
+ return (object)array('output' => $output, 'exitcode' => (integer)$exitcode);
}
public function bconsoleCommand($director, array $command, $user = null) {
}
private function execCommand($director, array $command, $user) {
+ $cmd = '';
if(!is_null($director) && $this->isValidDirector($director) === false) {
$output = array(BconsoleError::MSG_ERROR_INVALID_DIRECTOR, '');
$exitcode = BconsoleError::ERROR_INVALID_DIRECTOR;
public function testBconsoleCommand(array $command, $bconsoleCmdPath, $bconsoleCfgPath, $useSudo) {
$this->setEnvironmentParams($bconsoleCmdPath, $bconsoleCfgPath, null, $useSudo);
$director = array_shift($this->getDirectors()->output);
- return $this->bconsoleCommand($director, $command);
+ $result = $this->bconsoleCommand($director, $command);
+ return $result;
}
}
-?>
\ No newline at end of file
+?>