Created
May 10, 2014 04:15
both of these scripts are called using your image file as the argument
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f $1 ]; then | |
echo no file to close | |
exit 1 | |
fi | |
LUFIL=$1 | |
LODEV=$(losetup -j $LUFIL | cut -d: -f1) | |
MNAM="derp" | |
umount /media/$MNAM | |
cryptsetup luksClose $MNAM | |
losetup -d $LODEV | |
rmdir /media/$MNAM | |
echo done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f $1 ]; then | |
echo no file given | |
exit 1 | |
fi | |
modprobe dm_crypt | |
modprobe loop | |
LUFIL=$1 | |
LODEV=$(losetup -f) | |
MNAM="derp" | |
losetup $LODEV $LUFIL | |
cryptsetup luksOpen $LODEV $MNAM | |
mkdir -p /media/$MNAM | |
mount /dev/mapper/$MNAM /media/$MNAM | |
echo done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment