diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index e70b53e0..93f2e37a 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -47,9 +47,8 @@ class Shutdown extends Component public function shutdown(): void { clearstatcache(storage()); - $output = shell_exec('ls -alh /.dockerenv'); - var_dump($output); - if (!empty($output)) { + $output = shell_exec('[ -f /.dockerenv ] && echo yes || echo no'); + if ($output === 'yes') { return; } diff --git a/System/Snowflake.php b/System/Snowflake.php index 2a8d2d56..d5e31706 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -243,8 +243,8 @@ class Snowflake */ public static function isDcoker(): bool { - exec('ls -alh /.dockerenv', $output, $cod); - if ($cod === 0 && !empty($output)) { + exec('[ -f /.dockerenv ] && echo yes || echo no', $output, $cod); + if ($cod === 0 && $output === 'yes') { return true; } return false;