Closed tdiprima closed 6 years ago
If you create a symlink and then call the command again, you will get an additional symlink created within the symlink'ed directory.
E.g. when you've done the command once, there is now a link /var/www/html/overlays
that points to the directory /data/images/overlays
. I.e., /var/www/html/overlays
is now a directory. Therefore, when you do the command a subsequent time, a new link named overlays is added to that directory.
Changing the command to ln -sTf [source] [target]
will (by -T
) tell ln
to treat any existing /var/www/html/overlays as a plain file (the link), and (by -f
) force that file to be replaced.
OR - check existence
link='/var/www/html/overlays'
if [ ! -L $link ]; then
# create the link
fi
Test this fix: https://github.com/camicroscope/ViewerDockerContainer/pull/82/commits/bf9aa5ffbb7b78d00e82f5511f2abf5ef02c490d
Versus this one, which is known to be tested: https://github.com/camicroscope/ViewerDockerContainer/commit/b9fd1f15834e340e0a4a099d0f293d2ff52545d0
Potentially add another check to see if the symlink exists.