fix(terminal): terminal shows that it is not available, even though it is
This commit is contained in:
@@ -146,11 +146,16 @@ class ExecuteContainerCommand extends Component
|
|||||||
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')]
|
||||||
|
|||||||
Reference in New Issue
Block a user