From 232018c925e4857b2c386bc3f8b25ba01784b82c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 3 Nov 2022 11:40:55 +0100 Subject: [PATCH] fix --- apps/api/src/lib/common.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index e2470daa4..c4bca0d6e 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -537,13 +537,16 @@ export async function createRemoteEngineConfiguration(id: string) { const config = sshConfig.parse(''); const Host = `${remoteIpAddress}-remote` - await asyncExecShell(`ssh-keygen -R ${Host}`); - await asyncExecShell(`ssh-keygen -R ${remoteIpAddress}`); - await asyncExecShell(`ssh-keygen -R localhost:${localPort}`); + try { + await asyncExecShell(`ssh-keygen -R ${Host}`); + await asyncExecShell(`ssh-keygen -R ${remoteIpAddress}`); + await asyncExecShell(`ssh-keygen -R localhost:${localPort}`); + } catch (error) { } + const found = config.find({ Host }); const foundIp = config.find({ Host: remoteIpAddress }); - + if (found) config.remove({ Host }) if (foundIp) config.remove({ Host: remoteIpAddress })