Created
August 11, 2012 14:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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