fix(terminal): terminal shows that it is not available, even though it is
This commit is contained in:
parent
1b62e1f117
commit
007e291bef
1 changed files with 9 additions and 4 deletions
|
|
@ -146,11 +146,16 @@ public function loadContainers()
|
|||
private function checkShellAvailability(Server $server, string $container): bool
|
||||
{
|
||||
$escapedContainer = escapeshellarg($container);
|
||||
$result = instant_remote_process([
|
||||
"docker exec {$escapedContainer} which bash || docker exec {$escapedContainer} which sh",
|
||||
], $server, false);
|
||||
try {
|
||||
instant_remote_process([
|
||||
"docker exec {$escapedContainer} bash -c 'exit 0' 2>/dev/null || ".
|
||||
"docker exec {$escapedContainer} sh -c 'exit 0' 2>/dev/null",
|
||||
], $server);
|
||||
|
||||
return ! empty($result);
|
||||
return true;
|
||||
} catch (\Throwable) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#[On('connectToServer')]
|
||||
|
|
|
|||
Loading…
Reference in a new issue