Created
May 31, 2011 12:55
-
-
Save jonyesno/1000454 to your computer and use it in GitHub Desktop.
OS X crypto fs mounter
This file contains hidden or 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/sh | |
CFS="key: zomo: mobilesync:-nobrowse documents:-nobrowse" | |
for _C in ${CFS} ; do | |
C=${_C/:*/} # fs | |
O=${_C/*:/} # options | |
DMG=${HOME}/cfs/${C}.dmg | |
if [ ! -f ${DMG} ] ; then | |
echo no ${DMG} for ${C} | |
next | |
fi | |
if mount | grep -q /Volumes/${C} ; then | |
echo ${C} already mounted | |
else | |
hdiutil attach ${O} ${DMG} | |
mount -u -onoatime,noowners /Volumes/${C} | |
echo ${C} mounted | |
fi | |
mount | grep /Volumes/${C} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment