Skip to content

Commit 32c35d6

Browse files
Modified Uninstallation Behavior
Modified Uninstallation prompt to NOT keep/save configuration file by default when called from the WebGUI.
1 parent f1e2938 commit 32c35d6

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

MerlinAU.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7-
# Last Modified: 2025-Jan-18
7+
# Last Modified: 2025-Jan-20
88
###################################################################
99
set -u
1010

@@ -310,15 +310,22 @@ _WaitForEnterKey_()
310310
read -rs EnterKEY ; echo
311311
}
312312

313-
##----------------------------------##
314-
## Added Martinski W. [2023-Nov-28] ##
315-
##----------------------------------##
313+
##-------------------------------------##
314+
## Modified Martinski W. [2025-Jan-20] ##
315+
##-------------------------------------##
316316
_WaitForYESorNO_()
317317
{
318-
! "$isInteractive" && return 0
319-
local promptStr
318+
local retCode defltAnswer promptStr
320319

321-
if [ $# -eq 0 ] || [ -z "$1" ]
320+
if [ $# -gt 0 ] && [ "$1" = "NO" ]
321+
then retCode=1 ; defltAnswer="NO"
322+
else retCode=0 ; defltAnswer="YES"
323+
fi
324+
325+
! "$isInteractive" && return "$retCode"
326+
327+
if [ $# -eq 0 ] || [ -z "$1" ] || \
328+
echo "$1" | grep -qE "^(YES|NO)$"
322329
then promptStr=" [yY|nN]? "
323330
else promptStr="$1 [yY|nN]? "
324331
fi
@@ -8745,7 +8752,7 @@ _DoInstallation_()
87458752
}
87468753

87478754
##----------------------------------------##
8748-
## Modified by Martinski W. [2025-Jan-18] ##
8755+
## Modified by Martinski W. [2025-Jan-20] ##
87498756
##----------------------------------------##
87508757
_DoUnInstallation_()
87518758
{
@@ -8758,7 +8765,7 @@ _DoUnInstallation_()
87588765
local savedCFGPath="${SCRIPTS_PATH}/${SCRIPT_NAME}_CFG.SAVED.TXT"
87598766

87608767
printf "\n${BOLDct}Do you want to keep/save the $SCRIPT_NAME configuration file${NOct}"
8761-
if _WaitForYESorNO_
8768+
if _WaitForYESorNO_ NO
87628769
then
87638770
doSaveConfig=true
87648771
mv -f "$CONFIG_FILE" "$savedCFGPath"

0 commit comments

Comments
 (0)