From 26a4b8190acaa7bd2f4fa7b6c0aeb33693c5188c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 2 Mar 2021 12:39:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Action.php | 8 ++++---- HttpServer/Server.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/HttpServer/Action.php b/HttpServer/Action.php index 1cb6d3b8..cb976169 100644 --- a/HttpServer/Action.php +++ b/HttpServer/Action.php @@ -56,7 +56,7 @@ trait Action return; } $content = file_get_contents($pid_file); - Coroutine\System::exec("ps -ef $content | grep $content", $output); + $output = Coroutine\System::exec("ps -ef $content | grep $content"); if (!empty($output)) { Coroutine\System::exec("kill -15 $content"); } @@ -108,7 +108,7 @@ trait Action } foreach ($files as $file) { $content = file_get_contents($file->getRealPath()); - Coroutine\System::exec("ps -ax | awk '{ print $1 }' | grep -e '^{$content}$'", $output); + $output = Coroutine\System::exec("ps -ax | awk '{ print $1 }' | grep -e '^{$content}$'"); if (count($output) > 0) { $this->closeByPid($content); } else { @@ -138,9 +138,9 @@ trait Action return false; } if (Snowflake::isLinux()) { - Coroutine\System::exec('netstat -tunlp | grep ' . $port, $output); + $output = Coroutine\System::exec('netstat -tunlp | grep ' . $port); } else { - Coroutine\System::exec('lsof -i :' . $port . ' | grep -i "LISTEN"', $output); + $output = Coroutine\System::exec('lsof -i :' . $port . ' | grep -i "LISTEN"'); } if (empty($output)) { return false; diff --git a/HttpServer/Server.php b/HttpServer/Server.php index e819243e..7f6b1b4e 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -180,9 +180,9 @@ class Server extends HttpService } foreach ($port as $value) { if (Snowflake::isLinux()) { - Coroutine\System::exec('netstat -tunlp | grep ' . $value['port'], $output); + $output = Coroutine\System::exec('netstat -tunlp | grep ' . $value['port']); } else { - Coroutine\System::exec('lsof -i :' . $value['port'] . ' | grep -i "LISTEN"', $output); + $output = Coroutine\System::exec('lsof -i :' . $value['port'] . ' | grep -i "LISTEN"'); } if (!empty($output)) { return true;