This commit is contained in:
2021-03-04 14:40:33 +08:00
parent 486daf639a
commit 5d1a3b3533
10 changed files with 67 additions and 42 deletions
+2 -1
View File
@@ -177,6 +177,7 @@ class Server extends HttpService
/**
* @return bool
* @throws ConfigException
* @throws Exception
*/
public function isRunner(): bool
{
@@ -185,7 +186,7 @@ class Server extends HttpService
return false;
}
foreach ($port as $value) {
if (Snowflake::isLinux()) {
if (Snowflake::getPlatform()->isLinux()) {
exec('netstat -tunlp | grep ' . $value['port'], $output);
} else {
exec('lsof -i :' . $value['port'] . ' | grep -i "LISTEN"', $output);