} else { $console->writeln($line); } } end($output); if (prev($output) === 'FAILURES!') { exit; } unset($output); chdir(__DIR__); } $config = Cerberus::loadConfig(); if ($config['bot']['autostart']) { $db = new Db($config['db']); $db->connect(); $bots = $db->getActiveBotList(); $botCount = 0; if ($bots) { exec('ps -e | grep php', $output); $pidList = []; foreach ($output as $line) { $data = explode(' ', trim(preg_replace('/[ ]+/', ' ', $line))); if ($data[3] === 'php') { $pidList[] = $data[0]; } } foreach ($bots as $bot) { if (in_array($bot['pid'], $pidList, true) === true) { $botCount++; Cerberus::sysinfo('Bot ' . $bot['id'] . ' is running. PID: ' . $bot['pid']); } else {