Skip to content

Instantly share code, notes, and snippets.

@photuris
Created September 17, 2010 17:18
Show Gist options
  • Save photuris/584575 to your computer and use it in GitHub Desktop.
Save photuris/584575 to your computer and use it in GitHub Desktop.
#!/bin/bash
COMMAND='/Applications/TrueCrypt.app/Contents/MacOS/TrueCrypt'
DISKNAME='Development'
IMAGEFILE='/Users/Joshua/Development'
# Is the volume already mounted?
if [ -z `ls -1 /Volumes/ | grep $DISKNAME` ] ; then
echo Mounting Volume \"$DISKNAME\"
# Automount, prompting for password
$COMMAND --mount $IMAGEFILE /Volumes/$DISKNAME
# OS X mounts "external" volumes with -noowners by default,
# so we remount with full ownership enabled.
# Maybe there's a cleaner workaround for this...
sudo mount -u -o owners /Volumes/Development
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment