mirror of
https://github.com/yanfeizhang/coder-kung-fu.git
synced 2026-05-08 06:52:39 +08:00
24 lines
421 B
PHP
Executable File
24 lines
421 B
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Socket服务端
|
|
*/
|
|
|
|
require("ports.php");
|
|
|
|
$cmd = "ps -ef | grep server.php | awk '{print $2}' | xargs kill -9";
|
|
shell_exec($cmd);
|
|
shell_exec("echo '' > serverd.log");
|
|
|
|
if(isset($argv[1]) && "stop"==$argv[1]){
|
|
exit;
|
|
}
|
|
|
|
foreach($ports as $port){
|
|
$tCommand = "php server.php 0.0.0.0 $port >> serverd.log &";
|
|
echo $tCommand."\n";
|
|
shell_exec($tCommand);
|
|
sleep(1);
|
|
}
|
|
|