Guest User

Untitled

a guest
Jan 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. 'use strict'
  2.  
  3. const Connection = require('simple-ssh')
  4.  
  5. exports.reboot_bots = async (req, res, next) => {
  6. const ssh = new Connection({
  7. host: '',
  8. port: 8110,
  9. user: '',
  10. pass: ''
  11. // key: fs.readFileSync('/home/yuri/.ssh/id_rsa')
  12. })
  13.  
  14. await ssh.exec('pm2 restart 0', {
  15. pty: true,
  16. exit: function (exit, stdout, stderr) {
  17. res.end()
  18. }
  19.  
  20. }).start()
  21. }
Add Comment
Please, Sign In to add comment