Skip to content

Commit 332a7d1

Browse files
committed
more fun with the startup script
1 parent 48f9f7d commit 332a7d1

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

  • ext/central-controller-docker

ext/central-controller-docker/main.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22

33
if [ -z "$ZT_IDENTITY_PATH" ]; then
4-
echo '*** FAILED: ZT_IDENTITY_PATH environment variable is not defined'
5-
exit 1
64
fi
75
if [ -z "$ZT_DB_HOST" ]; then
86
echo '*** FAILED: ZT_DB_HOST environment variable not defined'
@@ -59,10 +57,14 @@ fi
5957
mkdir -p /var/lib/zerotier-one
6058

6159
pushd /var/lib/zerotier-one
62-
ln -s $ZT_IDENTITY_PATH/identity.public identity.public
63-
ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret
64-
if [ -f "$ZT_IDENTITY_PATH/authtoken.secret" ]; then
65-
ln -s $ZT_IDENTITY_PATH/authtoken.secret authtoken.secret
60+
if [ -d "$ZT_IDENTITY_PATH" ]; then
61+
echo '*** Using existing ZT identity from path $ZT_IDENTITY_PATH'
62+
63+
ln -s $ZT_IDENTITY_PATH/identity.public identity.public
64+
ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret
65+
if [ -f "$ZT_IDENTITY_PATH/authtoken.secret" ]; then
66+
ln -s $ZT_IDENTITY_PATH/authtoken.secret authtoken.secret
67+
fi
6668
fi
6769
popd
6870

0 commit comments

Comments
 (0)