From 64ecdf5b636c17b6c3f1814f2866d4833bee016d Mon Sep 17 00:00:00 2001 From: mreid-tt <943378+mreid-tt@users.noreply.github.com> Date: Sun, 28 Jan 2024 21:06:32 -0400 Subject: [PATCH] Enhance uninstall wizard --- spk/fengoffice/src/wizard/uninstall_uifile | 27 ------ spk/fengoffice/src/wizard/uninstall_uifile.sh | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 27 deletions(-) delete mode 100644 spk/fengoffice/src/wizard/uninstall_uifile create mode 100644 spk/fengoffice/src/wizard/uninstall_uifile.sh diff --git a/spk/fengoffice/src/wizard/uninstall_uifile b/spk/fengoffice/src/wizard/uninstall_uifile deleted file mode 100644 index 717cbe2e2038..000000000000 --- a/spk/fengoffice/src/wizard/uninstall_uifile +++ /dev/null @@ -1,27 +0,0 @@ -[{ - "step_title": "Remove fengoffice database", - "items": [{ - "desc": "Attention: The fengoffice database will be removed during package uninstallation. All users and projects will be deleted." - }, { - "type": "password", - "desc": "Enter your MySQL password", - "subitems": [{ - "key": "wizard_mysql_password_root", - "desc": "Root password" - }] - }, { - "type": "textfield", - "desc": "Optional: Provide directory for database export. Leave blank to skip export. The directory will be created if it does not exist", - "subitems": [{ - "key": "wizard_dbexport_path", - "desc": "Database export location", - "validator": { - "allowBlank": true, - "regex": { - "expr": "/^\\\/volume[0-9]+\\\//", - "errorText": "Path should begin with /volume?/ with ? the number of the volume" - } - } - }] - }] -}] diff --git a/spk/fengoffice/src/wizard/uninstall_uifile.sh b/spk/fengoffice/src/wizard/uninstall_uifile.sh new file mode 100644 index 000000000000..0dda7cd4d63e --- /dev/null +++ b/spk/fengoffice/src/wizard/uninstall_uifile.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +# for backwards compatability +if [ "$SYNOPKG_DSM_VERSION_MAJOR" -lt 7 ] && [ -z "${SYNOPKG_PKGDEST_VOL}" ]; then + SYNOPKG_PKGDEST_VOL="/volume1" +fi + +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 +} + +ERROR_TEXT="Path should begin with /volume?/ with ? the number of the volume" + +getValidPath() +{ + VALID_PATH=$(/bin/cat< "${SYNOPKG_TEMP_LOGFILE}" +} + +main "$@"