From 85c6583da911a034d7e9663a175a36fe7eb64d2d Mon Sep 17 00:00:00 2001 From: hgy59 Date: Sun, 15 Oct 2023 22:12:06 +0200 Subject: [PATCH 1/2] fix shared folder handling - fix initialization of SHARE_NAME from SHARE_PATH --- mk/spksrc.service.installer.functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.service.installer.functions b/mk/spksrc.service.installer.functions index 4e7890b118f..b59a1747469 100644 --- a/mk/spksrc.service.installer.functions +++ b/mk/spksrc.service.installer.functions @@ -62,7 +62,7 @@ initialize_variables () install_log "SHARE_PATH is absolute path [${SHARE_PATH}]." fi if [ -z "${SHARE_NAME}" ]; then - SHARE_NAME=$(echo $(abspath ${SHARE_PATH}) | awk -F/ '{print $3}') + SHARE_NAME=$(echo $(realpath ${SHARE_PATH}) | awk -F/ '{print $3}') fi fi } From 7902252b05e1679cce7f9b5ddb93a59e4888e196 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 16 Oct 2023 21:40:08 +0200 Subject: [PATCH 2/2] use basename to evaluate share name from path --- mk/spksrc.service.installer.functions | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mk/spksrc.service.installer.functions b/mk/spksrc.service.installer.functions index b59a1747469..c46e002b19b 100644 --- a/mk/spksrc.service.installer.functions +++ b/mk/spksrc.service.installer.functions @@ -47,7 +47,6 @@ initialize_variables () # Extract share volume and share name from share path when provided, and not already defined if [ -n "${SHARE_PATH}" ]; then - install_log "Evaluate full path for SHARE_NAME [${SHARE_NAME}] and SHARE_PATH [${SHARE_PATH}]" # migrate SHARE_PATH that holds the share name only to full share path # this is required for installers without resource worker for file share (SRM 1, DSM 5, DSM 6 old packages) if [ "$(echo ${SHARE_PATH} | grep ^/)" != "${SHARE_PATH}" ]; then @@ -58,12 +57,11 @@ initialize_variables () else install_log "SHARE_NAME is not an existing share [${SHARE_PATH}]." fi - else - install_log "SHARE_PATH is absolute path [${SHARE_PATH}]." fi if [ -z "${SHARE_NAME}" ]; then - SHARE_NAME=$(echo $(realpath ${SHARE_PATH}) | awk -F/ '{print $3}') + SHARE_NAME=$(basename ${SHARE_PATH}) fi + install_log "Shared folder configured with SHARE_NAME [${SHARE_NAME}] and SHARE_PATH [${SHARE_PATH}]" fi }