mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 10:31:17 -03:00
Refactor the structure of the source
Common part is moved to common dir
This commit is contained in:
parent
ea49d6d082
commit
0b392629c9
6 changed files with 14 additions and 11 deletions
87
script/common/_confirmation.sh
Normal file
87
script/common/_confirmation.sh
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
# *******************************************************************************
|
||||
# Confirmation and Passphrase setting
|
||||
# *******************************************************************************
|
||||
|
||||
# Sanity check for volume group name
|
||||
if echo ${VGNAME} | grep "-" -i > /dev/null ; then # "-" is found in the volume group name.
|
||||
cat <<HEREDOC 1>&2
|
||||
***** ERROR : VGNAME is "${VGNAME}" *****
|
||||
THe "-" is not allowed in the volume name.
|
||||
Check passphrase and config.txt
|
||||
|
||||
Installation terminated.
|
||||
HEREDOC
|
||||
return
|
||||
fi # "-" is found in the volume group name.
|
||||
|
||||
# Sanity check for root volume name
|
||||
if echo ${LVROOTNAME} | grep "-" -i > /dev/null ; then # "-" is found in the volume name.
|
||||
cat <<HEREDOC 1>&2
|
||||
***** ERROR : LVROOTNAME is "${LVROOTNAME}" *****
|
||||
THe "-" is not allowed in the volume name.
|
||||
Check passphrase and config.txt
|
||||
|
||||
Installation terminated.
|
||||
HEREDOC
|
||||
return
|
||||
fi # "-" is found in the volume name.
|
||||
|
||||
# Sanity check for swap volume name
|
||||
if echo ${LVSWAPNAME} | grep "-" -i > /dev/null ; then # "-" is found in the volume name.
|
||||
cat <<HEREDOC 1>&2
|
||||
***** ERROR : LVSWAPNAME is "${LVSWAPNAME}" *****
|
||||
THe "-" is not allowed in the volume name.
|
||||
Check passphrase and config.txt
|
||||
|
||||
Installation terminated.
|
||||
HEREDOC
|
||||
return
|
||||
fi # "-" is found in the volume name.
|
||||
|
||||
# For surre ask the config.sh is edited
|
||||
cat <<HEREDOC
|
||||
|
||||
The destination logical volume label is "${LVROOTNAME}"
|
||||
"${LVROOTNAME}" uses ${LVROOTSIZE} of the LVM volume group.
|
||||
Are you ready to install? [Y/N]
|
||||
HEREDOC
|
||||
read YESNO
|
||||
if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then
|
||||
cat <<HEREDOC 1>&2
|
||||
|
||||
Installation terminated.
|
||||
HEREDOC
|
||||
return
|
||||
fi # if YES
|
||||
|
||||
# For sure ask ready to erase.
|
||||
if [ ${ERASEALL} -eq 1 ] ; then
|
||||
echo "Are you sure you want to erase entire ${DEV}? [Y/N]"
|
||||
read YESNO
|
||||
if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then
|
||||
cat <<HEREDOC 1>&2
|
||||
Check config.sh. The variable ERASEALL is ${ERASEALL}.
|
||||
|
||||
Installation terminated.
|
||||
HEREDOC
|
||||
return
|
||||
fi # if YES
|
||||
fi # if erase all
|
||||
|
||||
# ----- Set Passphrase -----
|
||||
# Input passphrase
|
||||
echo "Type passphrase for the disk encryption."
|
||||
read -sr PASSPHRASE
|
||||
export PASSPHRASE
|
||||
|
||||
echo "Type passphrase again, to confirm."
|
||||
read -sr PASSPHRASE_C
|
||||
|
||||
# Validate whether both are indentical or not
|
||||
if [ ${PASSPHRASE} != ${PASSPHRASE_C} ] ; then
|
||||
cat <<HEREDOC 1>&2
|
||||
***** ERROR : Passphrase doesn't match *****
|
||||
Installation terminated.
|
||||
HEREDOC
|
||||
return
|
||||
fi # passphrase validation
|
||||
Loading…
Add table
Add a link
Reference in a new issue