From a18c73bd7c9e0a9c0af4255b758d30715c5cb012 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 5 Sep 2022 12:59:06 +0200 Subject: [PATCH] fix --- apps/api/src/lib/common.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index b97a6dfbf..215c5e093 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -463,6 +463,10 @@ export async function createRemoteEngineConfiguration(id: string) { const { stdout: numberOfSSHAgentsRunning } = await asyncExecShell(`ps ax | grep [s]sh-agent | grep coolify-ssh-agent.pid | grep -v grep | wc -l`) console.log({ numberOfSSHAgentsRunning }) if (numberOfSSHAgentsRunning !== '' && Number(numberOfSSHAgentsRunning.trim()) == 0) { + try { + await fs.stat(`/tmp/coolify-ssh-agent.pid`) + await fs.rm(`/tmp/coolify-ssh-agent.pid`) + } catch (error) { } await asyncExecShell(`eval $(ssh-agent -sa /tmp/coolify-ssh-agent.pid)`) } await asyncExecShell(`SSH_AUTH_SOCK=/tmp/coolify-ssh-agent.pid ssh-add -q ${sshKeyFile}`)