From c02a42e4d1b362e14ddc7ca33b9d3dc2bd0fcb64 Mon Sep 17 00:00:00 2001 From: mreid-tt <943378+mreid-tt@users.noreply.github.com> Date: Tue, 14 Nov 2023 14:31:02 -0400 Subject: [PATCH] Add DSM 6 wizard checks for multiple PHP profiles --- spk/selfoss/src/wizard/install_uifile.sh | 50 ++++++++++++++++++++ spk/selfoss/src/wizard/install_uifile_fre.sh | 50 ++++++++++++++++++++ spk/selfoss/src/wizard/uninstall_uifile | 4 +- spk/selfoss/src/wizard/uninstall_uifile_fre | 6 +-- 4 files changed, 103 insertions(+), 7 deletions(-) create mode 100644 spk/selfoss/src/wizard/install_uifile.sh create mode 100644 spk/selfoss/src/wizard/install_uifile_fre.sh diff --git a/spk/selfoss/src/wizard/install_uifile.sh b/spk/selfoss/src/wizard/install_uifile.sh new file mode 100644 index 00000000000..67f41cd30f3 --- /dev/null +++ b/spk/selfoss/src/wizard/install_uifile.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +quote_json () +{ + sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' +} + +page_append () +{ + if [ -z "$1" ]; then + echo "$2" + elif [ -z "$2" ]; then + echo "$1" + else + echo "$1,$2" + fi +} + +# Check for multiple PHP profiles +check_php_profiles () +{ + PHP_CFG_PATH="/usr/syno/etc/packages/WebStation/PHPSettings.json" + if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then + if jq -e 'to_entries | map(select((.key | startswith("com-synocommunity-packages-")) and .key != "com-synocommunity-packages-selfoss")) | length > 0' "${PHP_CFG_PATH}" >/dev/null; then + return 0 # true + else + return 1 # false + fi + fi +} + +PAGE_PHP_PROFILES=$(/bin/cat< "${SYNOPKG_TEMP_LOGFILE}" +} + +main "$@" diff --git a/spk/selfoss/src/wizard/install_uifile_fre.sh b/spk/selfoss/src/wizard/install_uifile_fre.sh new file mode 100644 index 00000000000..d3b1a9e9efd --- /dev/null +++ b/spk/selfoss/src/wizard/install_uifile_fre.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +quote_json () +{ + sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' +} + +page_append () +{ + if [ -z "$1" ]; then + echo "$2" + elif [ -z "$2" ]; then + echo "$1" + else + echo "$1,$2" + fi +} + +# Check for multiple PHP profiles +check_php_profiles () +{ + PHP_CFG_PATH="/usr/syno/etc/packages/WebStation/PHPSettings.json" + if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then + if jq -e 'to_entries | map(select((.key | startswith("com-synocommunity-packages-")) and .key != "com-synocommunity-packages-selfoss")) | length > 0' "${PHP_CFG_PATH}" >/dev/null; then + return 0 # true + else + return 1 # false + fi + fi +} + +PAGE_PHP_PROFILES=$(/bin/cat< "${SYNOPKG_TEMP_LOGFILE}" +} + +main "$@" diff --git a/spk/selfoss/src/wizard/uninstall_uifile b/spk/selfoss/src/wizard/uninstall_uifile index 78715a3e691..130c556d8b7 100644 --- a/spk/selfoss/src/wizard/uninstall_uifile +++ b/spk/selfoss/src/wizard/uninstall_uifile @@ -1,8 +1,6 @@ [{ "step_title": "Remove selfoss database", "items": [{ - "desc": "Attention: The selfoss database will be removed during package uninstallation. All feeds will be deleted." - }, { - "desc": "Optional: Use the 'Export sources' function within 'Settings' to keep a backup of your feeds." + "desc": "Attention: The selfoss database will be deleted when uninstalling the package, resulting in the removal of all feeds. Optionally, safeguard your feeds by utilizing the 'Export sources' function in the 'Settings' menu to create a backup." }] }] diff --git a/spk/selfoss/src/wizard/uninstall_uifile_fre b/spk/selfoss/src/wizard/uninstall_uifile_fre index 2c452577cbc..14b8d1f63bd 100644 --- a/spk/selfoss/src/wizard/uninstall_uifile_fre +++ b/spk/selfoss/src/wizard/uninstall_uifile_fre @@ -1,8 +1,6 @@ [{ - "step_title": "Suppression de la base de donnée selfoss", + "step_title": "Supprimer la base de données Selfoss", "items": [{ - "desc": "Si vous supprimez la base de donnée selfoss, tous les flux seront supprimées." - }, { - "desc": "Facultatif: Utilisez la fonction « Exporter les sources » dans « Paramètres » pour conserver une sauvegarde de vos flux." + "desc": "Attention : La base de données selfoss sera supprimée lors de la désinstallation du package, entraînant la suppression de tous les flux. Vous pouvez éventuellement sauvegarder vos flux en utilisant la fonction « Exporter les sources » dans le menu « Paramètres » pour créer une sauvegarde." }] }]