Skip to content

Instantly share code, notes, and snippets.

@jadams
Created June 19, 2016 01:28
Show Gist options
  • Save jadams/948cb5b8b1230595fcc379f08a4e56cb to your computer and use it in GitHub Desktop.
Save jadams/948cb5b8b1230595fcc379f08a4e56cb to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ "$UID" -ne "0" ]
then
echo Must be run as root.
exit 1
fi
if [ ! -f "$1" ]
then
echo Source not found.
exit 1
fi
if [ ! -d "$2" ]
then
echo Mountpoint does not exist.
exit 1
fi
VERANAME=vera$(date +%Y%m%d%H%M%S)
cryptsetup open --type tcrypt --veracrypt "$1" "$VERANAME"
mount -o,uid=1000,gid=1000,umask=0022,x-gvfs-show /dev/mapper/"$VERANAME" "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment