summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinstall.sh23
1 files changed, 18 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index 1465412..31aa31f 100755
--- a/install.sh
+++ b/install.sh
@@ -102,14 +102,27 @@ printf ',%s,U,*\n,+,L\n' "${boot_size}" | sfdisk -qf -X gpt ${drive}
# Encryption setup
if [[ $encrypt == true ]]; then
+
+ # Read crypt password
+ echo "Enter a password for encryption"
+ while true; do
+ read -sr -p "Password (crypt): " cryptpassword
+ printf "\n"
+ read -sr -p "Confirm encryption password: " cryptpassword2
+ printf "\n"
+ [[ "${cryptpassword}" == "${cryptpassword2}" ]] && break
+ echo "Incorrect password!";
+ read -rp "Press ENTER to try again...";
+ done
+
# Create encrypted drive
- echo "${password}" | cryptsetup --hash sha512 \
- --pbkdf pbkdf2 \
- --label LUKS \
- luksFormat "${root}"
+ echo "${cryptpassword}" | cryptsetup --hash sha512 \
+ --pbkdf pbkdf2 \
+ --label LUKS \
+ luksFormat "${root}"
# Open encrypted drive
- echo "${password}" | cryptsetup luksOpen ${root} cryptroot
+ echo "${cryptpassword}" | cryptsetup luksOpen ${root} cryptroot
# Change root to mapper
root="/dev/mapper/cryptroot"