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.
etemp/umount-temp-volume

29 lines
414 B

7 years ago
#!/bin/bash
echo ">>> Initialising"
MOUNTPOINT=etemp
VOLNAME=etemp
4 years ago
METADIR=/tmp/.$USER-etemp
7 years ago
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."