This commit is contained in:
2021-04-19 14:52:53 +08:00
parent 31fdb9ec7b
commit 2095c0d579
2 changed files with 4 additions and 5 deletions
+2 -3
View File
@@ -47,9 +47,8 @@ class Shutdown extends Component
public function shutdown(): void public function shutdown(): void
{ {
clearstatcache(storage()); clearstatcache(storage());
$output = shell_exec('ls -alh /.dockerenv'); $output = shell_exec('[ -f /.dockerenv ] && echo yes || echo no');
var_dump($output); if ($output === 'yes') {
if (!empty($output)) {
return; return;
} }
+2 -2
View File
@@ -243,8 +243,8 @@ class Snowflake
*/ */
public static function isDcoker(): bool public static function isDcoker(): bool
{ {
exec('ls -alh /.dockerenv', $output, $cod); exec('[ -f /.dockerenv ] && echo yes || echo no', $output, $cod);
if ($cod === 0 && !empty($output)) { if ($cod === 0 && $output === 'yes') {
return true; return true;
} }
return false; return false;