diff options
Diffstat (limited to 'files/mount-media')
-rwxr-xr-x | files/mount-media | 5 |
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 |