From 1ca9e3465fad33971a1896e5610248a42862133d Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:08:59 +0900 Subject: [PATCH] Overwrite install is implemented Issue #5 OVERWRITEINSTALL confirmation is missing --- script/lib.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/script/lib.sh b/script/lib.sh index 7c874a6..18a412a 100644 --- a/script/lib.sh +++ b/script/lib.sh @@ -70,7 +70,7 @@ function confirmation(){ return 1 # with error status fi # if YES - # For sure ask to be sure to erase. + # For sure ask to erase. if [ "${ERASEALL}" -ne 0 ] ; then echo "Are you sure you want to erase entire ${DEV}? [Y/N]" read -r YESNO @@ -78,6 +78,19 @@ function confirmation(){ cat <<-HEREDOC ...Check your config.sh. The variable ERASEALL is ${ERASEALL}. + ...Installation process terminated.. + HEREDOC + return 1 # with error status + fi # if YES + + # For sure ask to overwrite. + if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then + echo "Are you sure you want to overwrite ${LVROOTNAME} in ${VGNAME}? [Y/N]" + read -r YESNO + if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then + cat <<-HEREDOC + ...Check your config.sh. The variable OVERWRITEINSTALL is ${OVERWRITEINSTALL}. + ...Installation process terminated.. HEREDOC return 1 # with error status