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# ##################################################################
99set -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