Update encrypt.sh

This commit is contained in:
proledatarian 2022-02-12 16:07:49 +00:00
parent e96494d411
commit 20ad1a26fe
1 changed files with 10 additions and 4 deletions

View File

@ -1,17 +1,23 @@
#!/bin/bash #!/bin/bash
# Get variable from filesystem. # Get variable from filesystem.
disk=$(</tmp/disk)2 part=$(</tmp/disk)2
# Encrypting partition. # Encrypting partition.
echo "Encrypting system partition." echo "Encrypting system partition."
echo -e echo -e
cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/$disk && #cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/$part &&
echo "Partition successfully encrypted." echo "Partition successfully encrypted."
echo -e
# Opening encrypted partition and mounting at /dev/mapper/lvm. # Opening encrypted partition and mounting at /dev/mapper/lvm.
echo "Opening and mounting encrypted partition." echo "Opening and mounting encrypted partition."
echo -e echo -e
cryptsetup luksOpen /dev/$disk lvm &&
echo #cryptsetup luksOpen /dev/$part lvm &&
echo "Partition opened and mounted:"
echo -e
disk="${part%?}"
lsblk | grep "$disk"