diff --git a/modules/systems/server/controllers/systems.server.controller.js b/modules/systems/server/controllers/systems.server.controller.js index b963bcb9..66f5d92a 100644 --- a/modules/systems/server/controllers/systems.server.controller.js +++ b/modules/systems/server/controllers/systems.server.controller.js @@ -140,14 +140,17 @@ exports.setSystemConfigContent = function (req, res) { exports.shellCommand = function (req, res) { if (req.user.isAdmin) { shell.exec(req.body.command, function (code, stdout, stderr) { - if (stderr) { + if (code !== 0) { return res.status(422).send({ code: code, + stdout: stdout, stderr: stderr }); } else { res.json({ - stdout: stdout + code: code, + stdout: stdout, + stderr: stderr }); } });