From fa375e2fd8c4099a477f4ca872f8d2abfd307d0e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 20 Sep 2024 14:39:58 +0200 Subject: [PATCH] refactor: Update install.sh script to check if coolify-db volume exists before generating SSH key --- other/nightly/install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/other/nightly/install.sh b/other/nightly/install.sh index 9c446e2cd..61acbd333 100755 --- a/other/nightly/install.sh +++ b/other/nightly/install.sh @@ -479,9 +479,10 @@ syncSshKeys() { fi } -IS_COOLIFY_VOLUME_EXISTS=$(docker volume inspect coolify-db 2>/dev/null) - -if [ -z "$IS_COOLIFY_VOLUME_EXISTS" ]; then +set +e +IS_COOLIFY_VOLUME_EXISTS=$(docker volume ls | grep coolify-db | wc -l) +set -e +if [ "$IS_COOLIFY_VOLUME_EXISTS" -eq 0 ]; then echo " - Generating SSH key." ssh-keygen -t ed25519 -a 100 -f /data/coolify/ssh/keys/id.$CURRENT_USER@host.docker.internal -q -N "" -C coolify chown 9999 /data/coolify/ssh/keys/id.$CURRENT_USER@host.docker.internal