Skip to content

Commit 330056f

Browse files
authored
fix shared folder handling (#5913)
* fix shared folder handling - fix initialization of SHARE_NAME from SHARE_PATH - use basename to evaluate share name from path
1 parent ecce16f commit 330056f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mk/spksrc.service.installer.functions

+2-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ initialize_variables ()
4747

4848
# Extract share volume and share name from share path when provided, and not already defined
4949
if [ -n "${SHARE_PATH}" ]; then
50-
install_log "Evaluate full path for SHARE_NAME [${SHARE_NAME}] and SHARE_PATH [${SHARE_PATH}]"
5150
# migrate SHARE_PATH that holds the share name only to full share path
5251
# this is required for installers without resource worker for file share (SRM 1, DSM 5, DSM 6 old packages)
5352
if [ "$(echo ${SHARE_PATH} | grep ^/)" != "${SHARE_PATH}" ]; then
@@ -58,12 +57,11 @@ initialize_variables ()
5857
else
5958
install_log "SHARE_NAME is not an existing share [${SHARE_PATH}]."
6059
fi
61-
else
62-
install_log "SHARE_PATH is absolute path [${SHARE_PATH}]."
6360
fi
6461
if [ -z "${SHARE_NAME}" ]; then
65-
SHARE_NAME=$(echo $(abspath ${SHARE_PATH}) | awk -F/ '{print $3}')
62+
SHARE_NAME=$(basename ${SHARE_PATH})
6663
fi
64+
install_log "Shared folder configured with SHARE_NAME [${SHARE_NAME}] and SHARE_PATH [${SHARE_PATH}]"
6765
fi
6866
}
6967

0 commit comments

Comments
 (0)