Advertisement
yurystanev

runnner PoC runExec()

Aug 22nd, 2019
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function runExec(container) {
  2.  
  3.     var options = {
  4.         Cmd: ['bash', '-c', './script.sh'],
  5.         AttachStdout: true,
  6.         AttachStderr: true
  7.     };
  8.  
  9.     container.exec(options, function (err, exec) {
  10.         if (err) return;
  11.         exec.start(function (err, stream) {
  12.             if (err) return;
  13.             container.modem.demuxStream(stream, process.stdout, process.stderr);
  14.         });
  15.     });
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement