#!/opt/local/bin/php array(), 'curl_mtgrabber' => array()); } switch ($argv[1]) { case 'add': shell_exec("./worker_". $argv[2] .".php > /www/parse.log &"); break; case 'remove': if (isset($workers[$argv[2]]) && count($workers[$argv[2]]) > 0) { $pid = $workers[$argv[2]][0]; shell_exec("kill $pid"); } case 'status': case 'list': foreach($workers as $type => $pids) { echo "$type: ". count($pids) ."\n"; } break; default: break; }