Skip to content

Commit

Permalink
fix shared folder handling (#5913)
Browse files Browse the repository at this point in the history
* fix shared folder handling
- fix initialization of SHARE_NAME from SHARE_PATH
- use basename to evaluate share name from path
  • Loading branch information
hgy59 authored Oct 16, 2023
1 parent ecce16f commit 330056f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mk/spksrc.service.installer.functions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 $(abspath ${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
}

Expand Down

0 comments on commit 330056f

Please sign in to comment.