Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Feb 13, 2025
1 parent 4ff8fb7 commit de4e951
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion plugin/YPTSocket/YPTSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,18 @@ function executeEveryDay()
static public function getStartServerCommand()
{
global $global;
$command = "nohup bash -c 'ulimit -n 1048576 && php {$global['systemRootPath']}plugin/YPTSocket/server.php &'";

// Check if ulimit is supported
$ulimitCheck = "bash -c 'ulimit -n 1048576 >/dev/null 2>&1 && echo supported || echo unsupported'";
$isUlimitSupported = trim(shell_exec($ulimitCheck));

// Construct command based on ulimit support
if ($isUlimitSupported === 'supported') {
$command = "nohup bash -c 'ulimit -n 1048576 && php {$global['systemRootPath']}plugin/YPTSocket/server.php &'";
} else {
$command = "nohup bash -c 'php {$global['systemRootPath']}plugin/YPTSocket/server.php &'";
}

return $command;
}

Expand Down

0 comments on commit de4e951

Please sign in to comment.