kaiten-yaki/ubuntu/2-para-install.sh
Suikan 1ee412ee12 Refactored script
Add config.txt confirmation
Erase all check is moved to before passphrase
Add more comment
2021-06-29 06:14:43 +09:00

37 lines
946 B
Bash

#!/bin/bash
# Varidate whether script is executed as sourced or not
(return 0 2>/dev/null) && sourced=1 || sourced=0
if [ $sourced -eq 0 ] ; then
cat <<HEREDOC 1>&2
***** ERROR : Must execute as source *****
Execute as following :
source 2-para-install.sh
Installation terminated.
HEREDOC
exit # use "exit" instead of "return", if not "sourced" execusion
fi # "sourced" validation
# Check whether grub configuration file is ready to write
if [ ! -e /target/etc/default/grub ] ; then
cat <<HEREDOC 1>&2
***** ERROR : The /target/etc/default/grub is not ready. *****
Perhaps, to early to execute this script.
Installation terminated.
HEREDOC
return
fi # if grub file exists
# Make target GRUB aware to the crypt partition
echo "GRUB_ENABLE_CRYPTODISK=y" >> /target/etc/default/grub
# Finishing message
cat <<HEREDOC
2-para-install.sh : Done.
Make sure to click "Continue Testing", when the Ubiquity installer finishes.
HEREDOC