From a1fe75ff2b56cc8dc021ded33be2d8a15c4144a7 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 3 Dec 2024 17:59:50 +0100 Subject: [PATCH] Change state directory logic - add check if `/config` exists - display warning if detection was not successful --- share/docker/tailscale_container_hook | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/docker/tailscale_container_hook b/share/docker/tailscale_container_hook index 3abfd2ae1..01ebd07a0 100755 --- a/share/docker/tailscale_container_hook +++ b/share/docker/tailscale_container_hook @@ -131,20 +131,20 @@ unset TS_PARAMS if [ ! -z "${SERVER_DIR}" ]; then TSD_STATE_DIR="${SERVER_DIR}/.tailscale_state" - echo "Settings Tailscale state dir to: ${TSD_STATE_DIR}" elif [ ! -z "${DATA_DIR}" ]; then TSD_STATE_DIR="${DATA_DIR}/.tailscale_state" - echo "Settings Tailscale state dir to: ${TSD_STATE_DIR}" elif [ ! -z "${USER_HOME}" ]; then TSD_STATE_DIR="${USER_HOME}/.tailscale_state" - echo "Settings Tailscale state dir to: ${TSD_STATE_DIR}" +elif [ -d "/config" ]; then + TSD_STATE_DIR="/config/.tailscale_state" else if [ -z "${TAILSCALE_STATE_DIR}" ]; then TAILSCALE_STATE_DIR="/config/.tailscale_state" + echo "WARNING: Couldn't detect persistent directory for .tailscale_state files! Enable Tailscale Advanced Settings and set the Tailscale State Directory!" fi TSD_STATE_DIR="${TAILSCALE_STATE_DIR}" - echo "Settings Tailscale state dir to: ${TSD_STATE_DIR}" fi +echo "Settings Tailscale state dir to: ${TSD_STATE_DIR}" if [ ! -d "${TSD_STATE_DIR}" ]; then mkdir -p ${TSD_STATE_DIR}