<?php
class VProcess
{
public static function is_running($cmd)
{
exec("ps ax | grep '".$cmd."' | grep -v grep", $output);
if (isset($output['0'])) {
return true;
}
return false;
}
public static function run($cmd, $background = false)
{
if ($background) {
$cmd .= ' >/dev/null &';
}
exec($cmd);
}
}