From dc2f7203ce2d2bff81867fc11fcb6879c48e42dc Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 1 Sep 2021 09:30:16 +1000 Subject: [PATCH] Revert "Revert to previous shared folder behavior DSM6" This reverts commit 85f8a517c237fd4925852c6c4b1e60f0b3e064cc. --- mk/spksrc.service.installer.dsm6 | 24 ------------------------ mk/spksrc.service.mk | 2 +- spk/sabnzbd/src/service-setup.sh | 4 ++++ 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/mk/spksrc.service.installer.dsm6 b/mk/spksrc.service.installer.dsm6 index 0b5829736f8..f77fcefb386 100644 --- a/mk/spksrc.service.installer.dsm6 +++ b/mk/spksrc.service.installer.dsm6 @@ -305,30 +305,6 @@ postinst () synogroup --rebuild all 2>&1 | install_log fi - # Share management - if [ -n "${SHARE_PATH}" ]; then - install_log "Configuring ${SHARE_PATH}" - # Create share if does not exist - # !"#$%&’()*+,/:;<=>?@[]nˆ`{} | - if ! synoshare --get "${SHARE_NAME}" &> /dev/null; then - synoshare --add "${SHARE_NAME}" "${SHARE_DESC}" "${SHARE_PATH}" "" "rw" "" 1 0 2>&1 | install_log - fi - - # Add user permission if no GROUP is set in UI - # GROUP permission will be added in set_syno_permissions - if [ ! -n "$GROUP" ] && [ -n "${EFF_USER}" ]; then - synoshare --setuser "${SHARE_NAME}" RW + "${EFF_USER}" 2>&1 | install_log - fi - synoshare --build 2>&1 | install_log - - $MKDIR "${SHARE_PATH}" - - # Permissions for folder, up to volume - if [ -n "$GROUP" ]; then - set_syno_permissions "${SHARE_PATH}" "${GROUP}" 2>&1 | install_log - fi - fi - $MKDIR "${SYNOPKG_PKGVAR}" 2>&1 | install_log call_func "service_postinst" install_log diff --git a/mk/spksrc.service.mk b/mk/spksrc.service.mk index 2f01f71dfc8..27de6e97b7a 100644 --- a/mk/spksrc.service.mk +++ b/mk/spksrc.service.mk @@ -190,7 +190,7 @@ ifneq ($(strip $(SPK_USR_LOCAL_LINKS)),) endif ifneq ($(strip $(SERVICE_WIZARD_SHARE)),) # e.g. SERVICE_WIZARD_SHARE=wizard_download_dir -ifeq ($(call version_ge, ${TCVERSION}, 7.0),1) +ifeq ($(call version_ge, ${TCVERSION}, 6.0),1) @jq --arg share "{{${SERVICE_WIZARD_SHARE}}}" --arg user sc-${SPK_USER} \ '."data-share" = {"shares": [{"name": $$share, "permission":{"rw":[$$user]}} ] }' $@ | sponge $@ endif diff --git a/spk/sabnzbd/src/service-setup.sh b/spk/sabnzbd/src/service-setup.sh index 6354cbd45d0..3021196f12c 100644 --- a/spk/sabnzbd/src/service-setup.sh +++ b/spk/sabnzbd/src/service-setup.sh @@ -38,6 +38,10 @@ service_postinst () mkdir -p "${shared_folder}/watch" fi + # add group (DSM6) + if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then + set_syno_permissions "${wizard_volume:=/volume1}/${wizard_download_dir:=downloads}" "${GROUP}" + fi # Install nice/ionice ${BIN}/busybox --install ${BIN}