release r012 fix CA container existence check
This commit is contained in:
@@ -262,8 +262,10 @@ function ca_install(string $template_url, string $name, string $overrides_json,
|
||||
|
||||
$template_path = "/boot/config/plugins/dockerMan/templates-user/my-$name.xml";
|
||||
if (file_exists($template_path)) fail("Template already exists: $name");
|
||||
$existing = trim(docker_exec('inspect --type container --format {{.Name}} ' . escapeshellarg($name)));
|
||||
if ($existing !== '' && stripos($existing, 'Error:') !== 0) fail("Container already exists: $name");
|
||||
$existing = trim(docker_exec(
|
||||
'ps -a --filter ' . escapeshellarg("name=^/$name$") . ' --format ' . escapeshellarg('{{.Names}}')
|
||||
));
|
||||
if (in_array($name, preg_split('/\R/', $existing) ?: [], true)) fail("Container already exists: $name");
|
||||
|
||||
$context = stream_context_create(['http' => [
|
||||
'timeout' => 30,
|
||||
|
||||
Reference in New Issue
Block a user