Public
Snippet $172 authored by iv

script for mounting luks encrypted devices

Edited
#! /bin/bash
if [ -z $1 ] ; then
    echo "Please, give a device as parameter, ex: /dev/sda"
    exit 1
fi
if  [ ! -d /media/removable/key ] ; then
    echo "New dir at /media/removable/key"
    mkdir /media/removable/key
fi
echo "Mounting $1 on /media/removable/key"
cryptsetup luksOpen $1 key
mount /dev/mapper/key /media/removable/key