aboutsummaryrefslogtreecommitdiff
path: root/files/mount-media
diff options
context:
space:
mode:
Diffstat (limited to 'files/mount-media')
-rwxr-xr-xfiles/mount-media5
1 files changed, 3 insertions, 2 deletions
diff --git a/files/mount-media b/files/mount-media
index c50352f..b643a31 100755
--- a/files/mount-media
+++ b/files/mount-media
@@ -7,7 +7,7 @@
MEDIA="$1"
VOLUME="$2"
BASENAME="`basename $0`"
-MOUNTPOINT="/media/usb"
+MOUNTPOINT="/media/$MEDIA"
# Check media config
if [ -z "$MEDIA" ]; then
@@ -36,8 +36,9 @@ if [ "$BASENAME" == "mount-media" ]; then
echo "Checking filesystem..."
$sudo fsck -v -y /dev/mapper/$MEDIA && \
echo "Mounting volume at $MOUNTPOINT..."
+ $sudo mkdir -p $MOUNTPOINT
$sudo mount /dev/mapper/$MEDIA $MOUNTPOINT
elif [ "$BASENAME" == "umount-media" ]; then
- $sudo umount /media/usb && \
+ $sudo umount $MOUNTPOINT && \
$sudo cryptsetup luksClose $MEDIA
fi