Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict'
- const Connection = require('simple-ssh')
- exports.reboot_bots = async (req, res, next) => {
- const ssh = new Connection({
- host: '',
- port: 8110,
- user: '',
- pass: ''
- // key: fs.readFileSync('/home/yuri/.ssh/id_rsa')
- })
- await ssh.exec('pm2 restart 0', {
- pty: true,
- exit: function (exit, stdout, stderr) {
- res.end()
- }
- }).start()
- }
Add Comment
Please, Sign In to add comment