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
|
private function checkShellAvailability(Server $server, string $container): bool
|
||||||
{
|
{
|
||||||
$escapedContainer = escapeshellarg($container);
|
$escapedContainer = escapeshellarg($container);
|
||||||
$result = instant_remote_process([
|
try {
|
||||||
"docker exec {$escapedContainer} which bash || docker exec {$escapedContainer} which sh",
|
instant_remote_process([
|
||||||
], $server, false);
|
"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')]
|
#[On('connectToServer')]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue