Hello:
Newbie question here: Trying to pass a var to the child_process shell command.
Not sure what should be proper syntax. Thnx
getting the following errors:
Newbie question here: Trying to pass a var to the child_process shell command.
Not sure what should be proper syntax. Thnx
Code:
const exec = require('child_process').exec
app.listen(port);
console.log('Server started! At [URL unfurl="true"]http://10.130.16.65:'[/URL] + port);
function execute(command) {
exec(command, (err, stdout, stderr) => {
process.stdout.write(stdout)
})
}
// [URL unfurl="true"]http://10.130.16.65:8080/api/qmgrs?id=root&qmgr=TEST[/URL]
app.get('/api/qmgrs', function(req, res) {
var user_id = req.param('id');
var QMGR = req.param('qmgr');
exec("sudo su mqm -c 'echo \"dis qmgr\" | runmqsc QMGR'", function(err, stdout, stderr) {
if (err) {
res.writeHead(500, {"Content-Type": "text/plain"});
res.end(stderr);
}
else {
res.writeHead(200,{"Content-Type": "text/plain"});
res.end(stdout);
}
});
});
getting the following errors:
Code:
stty: standard input: Inappropriate ioctl for device
stty: standard input: Inappropriate ioctl for device
stty: standard input: Inappropriate ioctl for device