Added volume name sanity check

This commit is contained in:
Suikan 2021-07-01 07:33:42 +09:00
parent cdb1b27439
commit 03299295a4
2 changed files with 78 additions and 0 deletions

View file

@ -41,6 +41,45 @@ HEREDOC
fi # "Void" is not found in the OS name.
# Sanity check for volume group name
echo ${VGNAME} | grep "-" -i > /dev/null
if [ $? -eq 0 ] ; 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
echo ${LVROOTNAME} | grep "-" -i > /dev/null
if [ $? -eq 0 ] ; 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
echo ${LVSWAPNAME} | grep "-" -i > /dev/null
if [ $? -eq 0 ] ; 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