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 1/4] 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 From c504de3d9b68efe663a746debee08bb00044275e Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:15:06 +0900 Subject: [PATCH 2/4] Fix unbalance if - fi --- script/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/lib.sh b/script/lib.sh index 18a412a..06ca086 100644 --- a/script/lib.sh +++ b/script/lib.sh @@ -82,6 +82,7 @@ function confirmation(){ HEREDOC return 1 # with error status fi # if YES + fi # if erase all # For sure ask to overwrite. if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then @@ -95,7 +96,7 @@ function confirmation(){ HEREDOC return 1 # with error status fi # if YES - fi # if erase all + fi # if overwrite # ----- Set Passphrase ----- # Input passphrase From 91db393dd2bd0d75e7038ad2700b67e6cb54a8d5 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:18:14 +0900 Subject: [PATCH 3/4] Add double quote for ease-of-read --- script/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/lib.sh b/script/lib.sh index 06ca086..d68bf77 100644 --- a/script/lib.sh +++ b/script/lib.sh @@ -72,7 +72,7 @@ function confirmation(){ # For sure ask to erase. if [ "${ERASEALL}" -ne 0 ] ; then - echo "Are you sure you want to erase entire ${DEV}? [Y/N]" + echo "Are you sure you want to erase entire \"${DEV}\"? [Y/N]" read -r YESNO if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then cat <<-HEREDOC @@ -86,7 +86,7 @@ function confirmation(){ # For sure ask to overwrite. if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then - echo "Are you sure you want to overwrite ${LVROOTNAME} in ${VGNAME}? [Y/N]" + echo "Are you sure you want to overwrite \"${LVROOTNAME}\" in \"${VGNAME}\"? [Y/N]" read -r YESNO if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then cat <<-HEREDOC From 70ae04d1e143e9f58159992cb22f51ad5b8480da Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:33:36 +0900 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c80ecd..1eb39aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Record of the modification in project development. ### Added ### Changed +- [Issue 5 : OVERWRITEINSTALL confirmation is missing](https://github.com/suikan4github/kaiten-yaki/issues/5) + ### Deprecated ### Removed ### Fixed