From 2a06f6623f6e9c0257f6b3b764e4781a241ff77d Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Thu, 9 Nov 2023 17:56:38 +0100 Subject: [PATCH] Permits the container to be restarted The startup (entrypoint) will exit if the ssh key was already copied to the root user configuration in a previous start. Making it conditional will permit one to restart the container with something `docker-compose restart master-libvirt`. Otherwise, the container needs to be deleted and restarted. --- docker-compose/start.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker-compose/start.sh b/docker-compose/start.sh index 51d18ea4..f78f9dea 100755 --- a/docker-compose/start.sh +++ b/docker-compose/start.sh @@ -30,9 +30,11 @@ echo "Crossbar started" # ssh-key to connect to workers if [[ $1 == "master-libvirt" ]]; then - mkdir /root/.ssh - cp id_ed25519 /root/.ssh - cp known_hosts /root/.ssh + [[ -d /root/.ssh ]] || { + mkdir /root/.ssh + cp id_ed25519 /root/.ssh + cp known_hosts /root/.ssh + } fi # loop for debug