From 78dc9f765f7a1209f79430d545eb25ec585a6769 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Tue, 8 Mar 2022 09:39:36 +0100 Subject: [PATCH] fix for yesno() function --- bash/dup-live-disk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/dup-live-disk.sh b/bash/dup-live-disk.sh index 76f6b7f..a4e08bb 100755 --- a/bash/dup-live-disk.sh +++ b/bash/dup-live-disk.sh @@ -194,7 +194,7 @@ yesno() { printf -v reason "*** $1 [y/n/q] ? " "${@:2}" while true; do - if [[ ! -z $YESNO ]]; then + if [[ $YESNO =~ ^(yes|no)$ ]]; then answer="$YESNO" # shellcheck disable=SC2059 printf "$reason%s\n" "$answer" @@ -337,7 +337,7 @@ GRUB=ask # install grub COPY=ask # do FS copies MARIADB=ask # stop/start mysql/mariadb MARIADBSTOPPED=no # mysql stopped ? -YESNO=ask # default answer +YESNO= # default answer # short and long options SOPTS="a:c:df:g:hM:m:nr:y"