mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-12-20 03:52:19 -06:00
feat: cli v0.2.0
This commit is contained in:
21
lib/pm2/stop.js
Normal file
21
lib/pm2/stop.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const { exec } = require('child_process');
|
||||
const detectPm2ProcessId = require('../utils/detectPm2ProcessId.js');
|
||||
|
||||
module.exports = async (argv, id) => {
|
||||
const pm2ProcessId = id || await detectPm2ProcessId();
|
||||
if(pm2ProcessId === false) {
|
||||
console.log('⚙️ Manager process not setup')
|
||||
return
|
||||
}
|
||||
|
||||
console.log('⚙️ Stopping PM2 process')
|
||||
exec(`pm2 stop ${pm2ProcessId}`, (err, stdout) => {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
return
|
||||
}
|
||||
console.log(stdout)
|
||||
})
|
||||
|
||||
console.log('🛑 PM2 process stopped')
|
||||
}
|
||||
Reference in New Issue
Block a user