scripts/mount-luks
2022-12-26 14:20:37 +01:00

14 lines
331 B
Bash
Executable File

#!/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