From ac5b63f1133db7430f93f31cfaf53ee71d3b82fe Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 30 Jan 2015 12:44:21 +0100 Subject: [PATCH] Ensure a symlink is not touched if files are already linked This should only happen in rare cases but might happen when the container is stopped and started again. Thanks @combro2k for the hint. --- scripts/docker-ts3.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/docker-ts3.sh b/scripts/docker-ts3.sh index b5f8a99..7231d7b 100644 --- a/scripts/docker-ts3.sh +++ b/scripts/docker-ts3.sh @@ -8,11 +8,13 @@ if [ -f $VOLUME/ts3server.sqlitedb ] echo "$VOLUME/ts3server.sqlitedb found. Creating Link between host-mounted db-file and ts3-folder." ln -s $VOLUME/ts3server.sqlitedb /opt/teamspeak3-server_linux-amd64/ts3server.sqlitedb fi + echo "2. Link the files-folder into the host-mounted volume." mkdir -p /teamspeak3/files -rm -rf /opt/teamspeak3-server_linux-amd64/files -ln -s /teamspeak3/files /opt/teamspeak3-server_linux-amd64/files - +if ! [ -L /opt/teamspeak3-server_linux-amd64/files ]; then + rm -rf /opt/teamspeak3-server_linux-amd64/files + ln -s /teamspeak3/files /opt/teamspeak3-server_linux-amd64/files +fi echo "3. Starting TS3-Server." echo "Check if ts3server.ini exists in host-mounted volume."