var exec = require('child_process').exec;
exec('pm2 describe roar-agent', function(err, stdout, stderr) {
var l;
if (stdout) {
l = stdout.split('\n').filter(l => l.indexOf('status') !== -1 && l.indexOf('online') !== -1);
}
if (!l || l.length !== 1) {
exec('{cmd}');
}
});