scripts/mount-luks

14 lines
331 B
Plaintext
Raw Normal View History

2022-12-26 14:20:37 +01:00
#!/bin/sh
# get the drive path
drive="$1"
# open the encrypted drive
sudo cryptsetup luksOpen $drive luks
# check if the /mnt/encrypted directory exists if not create it
[ -d "/mnt/encrypted/" ] || sudo mkdir -p /mnt/encrypted
# mount the decrypted drive to /mnt/encrypted/ directory
sudo mount /dev/mapper/luks /mnt/encrypted