Authored by 陈峰

test stdout

... ... @@ -170,17 +170,12 @@ class PageCahe extends Model {
return new Promise((resolve, reject) => {
//检查shell脚本的危险操作
if (self._checkDangerScript(script)) {
self._broadcast('ls');
self._broadcast(script);
// resolve();
let result = conn.exec('ls', (err, stream) => {
stream.on('data', function(data) {
self._broadcast('STDOUT: ' + data);
}).stderr.on('data', function(data) {
self._broadcast('STDERR: ' + data);
});
let result = conn.exec(script, (err, stream) => {
if (err) {
self._broadcast('执行错误:${err}');
reject(err);
self._broadcast('执行错误:${err}');
} else {
stream.on('exit', (code) => {
resolve();
... ...