#! /bin/bash

if [[ $# -ne 2 ]] || [[ ! -b "$1" ]]; then
    echo "Usage: [sudo] $0 PARTITION NAME

Opens a LUKS partition in PARTITION for use. The opened PARTITION is associated with /dev/mapper/NAME.

You will probably need to run this with sudo.

This script does not set up LUKS first. You may wish to use the create_luks script first.

After you run this script the first time, you will probably want to run put a filesystem on, for example:

     # mkfs.ext4 /dev/mapper/NAME

Once /dev/mapper/NAME has a filesystem, just mount it with, say:

     # mount /dev/mapper/NAME /mnt" | fmt -w66
    exit 
fi

cryptsetup luksOpen "$1" "$2"
