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
@@ -131,13 +131,14 @@ trait Action
/**
* @param $port
* @return bool|array
* @throws Exception
*/
private function isUse($port): bool|array
{
if (empty($port)) {
return false;
}
if (Snowflake::isLinux()) {
if (Snowflake::getPlatform()->isLinux()) {
exec('netstat -tunlp | grep ' . $port, $output);
} else {
exec('lsof -i :' . $port . ' | grep -i "LISTEN"', $output);