Skip to content

Instantly share code, notes, and snippets.

@jonyesno
Created May 31, 2011 12:55
Show Gist options
  • Save jonyesno/1000454 to your computer and use it in GitHub Desktop.
Save jonyesno/1000454 to your computer and use it in GitHub Desktop.
OS X crypto fs mounter
#!/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