Showing
1 changed file
with
3 additions
and
8 deletions
@@ -170,17 +170,12 @@ class PageCahe extends Model { | @@ -170,17 +170,12 @@ class PageCahe extends Model { | ||
170 | return new Promise((resolve, reject) => { | 170 | return new Promise((resolve, reject) => { |
171 | //检查shell脚本的危险操作 | 171 | //检查shell脚本的危险操作 |
172 | if (self._checkDangerScript(script)) { | 172 | if (self._checkDangerScript(script)) { |
173 | - self._broadcast('ls'); | 173 | + self._broadcast(script); |
174 | // resolve(); | 174 | // resolve(); |
175 | - let result = conn.exec('ls', (err, stream) => { | ||
176 | - stream.on('data', function(data) { | ||
177 | - self._broadcast('STDOUT: ' + data); | ||
178 | - }).stderr.on('data', function(data) { | ||
179 | - self._broadcast('STDERR: ' + data); | ||
180 | - }); | 175 | + let result = conn.exec(script, (err, stream) => { |
181 | if (err) { | 176 | if (err) { |
182 | - self._broadcast('执行错误:${err}'); | ||
183 | reject(err); | 177 | reject(err); |
178 | + self._broadcast('执行错误:${err}'); | ||
184 | } else { | 179 | } else { |
185 | stream.on('exit', (code) => { | 180 | stream.on('exit', (code) => { |
186 | resolve(); | 181 | resolve(); |
-
Please register or login to post a comment