This commit is contained in:
as2252258@163.com
2021-03-28 16:20:31 +08:00
parent 5f8a02d898
commit c0b0bd003d
+2 -1
View File
@@ -76,7 +76,8 @@ class Shutdown extends Component
*/
public function pidIsExists($content): bool
{
$content = shell_exec('ps -eo pid,cmd,state | grep ' . $content . ' | grep -v grep');
$shell = 'ps -eo pid,cmd,state | grep %d | grep -v grep';
exec(sprintf($shell, $content), $content, $code);
if (empty($content)) {
return false;
}