From 332a7d1488ce1946034f49ce67d13e445e1edc2a Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 1 May 2025 14:12:30 -0700 Subject: [PATCH] more fun with the startup script --- ext/central-controller-docker/main.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/central-controller-docker/main.sh b/ext/central-controller-docker/main.sh index becd6f814..7112e1676 100755 --- a/ext/central-controller-docker/main.sh +++ b/ext/central-controller-docker/main.sh @@ -1,8 +1,6 @@ #!/bin/bash if [ -z "$ZT_IDENTITY_PATH" ]; then - echo '*** FAILED: ZT_IDENTITY_PATH environment variable is not defined' - exit 1 fi if [ -z "$ZT_DB_HOST" ]; then echo '*** FAILED: ZT_DB_HOST environment variable not defined' @@ -59,10 +57,14 @@ fi mkdir -p /var/lib/zerotier-one pushd /var/lib/zerotier-one -ln -s $ZT_IDENTITY_PATH/identity.public identity.public -ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret -if [ -f "$ZT_IDENTITY_PATH/authtoken.secret" ]; then - ln -s $ZT_IDENTITY_PATH/authtoken.secret authtoken.secret +if [ -d "$ZT_IDENTITY_PATH" ]; then + echo '*** Using existing ZT identity from path $ZT_IDENTITY_PATH' + + ln -s $ZT_IDENTITY_PATH/identity.public identity.public + ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret + if [ -f "$ZT_IDENTITY_PATH/authtoken.secret" ]; then + ln -s $ZT_IDENTITY_PATH/authtoken.secret authtoken.secret + fi fi popd