You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
403 B
29 lines
403 B
7 years ago
|
#!/bin/bash
|
||
|
|
||
|
echo ">>> Initialising"
|
||
|
|
||
|
MOUNTPOINT=etemp
|
||
|
VOLNAME=etemp
|
||
|
METADIR=.etemp
|
||
|
|
||
|
if [[ `id -u` != 0 ]]; then
|
||
|
echo "WARNING: Not root. Running with sudo"
|
||
|
cd ~
|
||
|
sudo "$0"
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
echo ">>> Unmounting"
|
||
|
|
||
|
sudo umount $MOUNTPOINT || echo "WARNING: Cannot unmount $MOUNTPOINT"
|
||
|
|
||
|
echo ">>> Closing volume"
|
||
|
|
||
|
sudo cryptsetup luksClose $VOLNAME
|
||
|
|
||
|
echo ">>> Removing image"
|
||
|
|
||
|
rm $METADIR/image
|
||
|
|
||
|
echo "Done."
|