Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust wizard SHARENAME check
Browse files Browse the repository at this point in the history
mreid-tt committed Jan 6, 2024
1 parent 48b315a commit a51538d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions spk/sabnzbd/src/wizard/upgrade_uifile.sh
Original file line number Diff line number Diff line change
@@ -28,18 +28,14 @@ if [ -z "$PACKAGE_SHARE_NAME" ] && [ -d "/var/packages/${SYNOPKG_PKGNAME}/shares
PACKAGE_SHARE_NAME=${CONFIGURED_SHARE_NAME}
fi

WARNING_TEXT="IMPORTANT: If your download folder is not currently located in the specified share, a new share will be created. After the upgrade, you may need to manually update your configuration to reflect this new location."

# If consistent data share path, suppress user warning
if [ -n "$CONFIGURED_SHARE_PATH" ] && [ -n "$PACKAGE_SHARE_PATH" ] && [ "$CONFIGURED_SHARE_PATH" = "$PACKAGE_SHARE_PATH" ]; then
WARNING_TEXT=""
fi

# Check for data share
check_data_share ()
{
if [ -n "${PACKAGE_SHARE_NAME}" ]; then
return 0 # true
elif [ -n "$CONFIGURED_SHARE_PATH" ] && [ -n "$PACKAGE_SHARE_PATH" ] && [ "$CONFIGURED_SHARE_PATH" = "$PACKAGE_SHARE_PATH" ]; then
# If consistent data share path, arrume share name is correct
return 0 # true
else
return 1 # false
fi
@@ -65,7 +61,7 @@ PAGE_SHARE_UPGRADE=$(/bin/cat<<EOF
}
}]
},{
"desc": "${WARNING_TEXT}"
"desc": "IMPORTANT: If your download folder is not currently located in the specified share, a new share will be created. After the upgrade, you may need to manually update your configuration to reflect this new location."
}]
}
EOF
@@ -76,6 +72,13 @@ PAGE_DSM_PERMISSIONS=$(/bin/cat<<EOF
"step_title": "DSM Permissions",
"items": [{
"desc": "Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
},{
"type": "textfield",
"subitems": [{
"key": "wizard_shared_folder_name",
"defaultValue": "${CONFIGURED_SHARE_NAME}",
"hidden": true
}]
}]
}
EOF
@@ -85,8 +88,9 @@ main () {
local upgrade_page=""
if ! check_data_share; then
upgrade_page=$(page_append "$upgrade_page" "$PAGE_SHARE_UPGRADE")
else
upgrade_page=$(page_append "$upgrade_page" "$PAGE_DSM_PERMISSIONS")
fi
upgrade_page=$(page_append "$upgrade_page" "$PAGE_DSM_PERMISSIONS")
echo "[$upgrade_page]" > "${SYNOPKG_TEMP_LOGFILE}"
}

0 comments on commit a51538d

Please sign in to comment.