Skip to content

Instantly share code, notes, and snippets.

@joscha
Created August 11, 2012 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joscha/3324734 to your computer and use it in GitHub Desktop.
Save joscha/3324734 to your computer and use it in GitHub Desktop.
Shell file for mounting an encfs volume in OSX by using the keychain password
#!/bin/bash
target=/Volumes/tmp.mytarget
source=/Users/bla/Dropbox/encrypted
volname=EncodedDropbox
keychainPassword=encodedDropbox
mount | grep $target >/dev/null
[[ "$?" -eq "0" ]] && diskutil umount force $target
if [ ! -d $target ]
then
mkdir $target
chmod 0700 $target
fi
extpassCall="security 2>&1 > /dev/null -q find-generic-password -ga '$keychainPassword' | cut -d \\\" -f 2"
if [ -d $source ]
then
encfs $source $target --extpass="$extpassCall" -olocal -oallow_other -ovolname=$volname
else
echo "'$source' not available"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment