From bc3a3b852c2e7dddb0ffe3a6f9650f95b1a15593 Mon Sep 17 00:00:00 2001 From: Thomas Koehler Date: Thu, 13 Jan 2011 13:12:39 +0100 Subject: [PATCH] when no mountpoint is given for action start, use a default one Unfortunately, when you plug in a USB disk with an encrypted partition, no mount point for that partition is being created. This patch uses a default mountpoint if none is given to action "start" so that manual intervention (run mkdir first) is minimized. --- grml-crypt | 9 ++++----- grml-crypt.8.txt | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/grml-crypt b/grml-crypt index b9f0f26..581925a 100755 --- a/grml-crypt +++ b/grml-crypt @@ -83,8 +83,8 @@ ACTIONS: Format a device or a file (is created with the given size if it does not exist) with the given filesystem and mount it, if a mountpoint was given. - start - Mount the device/file in the mountpoint. + start [mountpoint] + Mount the device/file in the mountpoint or to a default mountpoint. stop Umount the given mountpoint (umount, luksClose, losetup -d) @@ -166,10 +166,9 @@ function actionStart { ret_=0 - # no mountpoint, by-by if [[ "$MOUNT_POINT_" == "" ]]; then - printUsage - die 'no mountpoint given' + MOUNT_POINT_="/mnt/$DM_NAME_" + mkdir $MOUNT_POINT_ fi if [ ! -d "$MOUNT_POINT_" ]; then die "mountpoint $MOUNT_POINT_ does not exist" diff --git a/grml-crypt.8.txt b/grml-crypt.8.txt index 1ff290d..43be27d 100644 --- a/grml-crypt.8.txt +++ b/grml-crypt.8.txt @@ -32,9 +32,9 @@ ACTIONS Commands: [losetup], dd, cryptsetup luksFormat, cryptsetup luksOpen, [dd], mkfs, [mount] -*start *:: +*start [mountpoint]*:: Starts an encrypted and mounts it to the given - mountpoint. Commands: [losetup], cryptsetup luksOpen, mount + or a default mountpoint. Commands: [losetup], cryptsetup luksOpen, mount *stop *:: Stops an encrypted filesystem mounted at . Even the -- 1.7.2.3