mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-07-13 07:04:50 -06:00
18 lines
462 B
JavaScript
18 lines
462 B
JavaScript
const { exec } = require('child_process');
|
|
|
|
module.exports = async () => {
|
|
return new Promise((resolve, reject) => {
|
|
exec('pm2 jlist', async (err, stdout) => {
|
|
if (err) {
|
|
console.log('⚙️ PM2 is not installed');
|
|
return reject(false);
|
|
}
|
|
|
|
const list = JSON.parse(stdout);
|
|
|
|
const process = list.find((process) => process.name === 'evolution-manager');
|
|
resolve(process ? process.pm_id : false);
|
|
});
|
|
});
|
|
|
|
} |