Skip to content

Instantly share code, notes, and snippets.

@chorn
Created December 18, 2013 20:51
Show Gist options
  • Save chorn/8029654 to your computer and use it in GitHub Desktop.
Save chorn/8029654 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [[ $# != 2 ]] ; then
echo "Usage: $0 <Size in GB> <Name>"
exit 1
fi
key=$(openssl rand -base64 100 | sed -e 'N;s/\n//')
echo SAVE THIS KEY: $key
echo $key |hdiutil create -size ${1}g -layout "UNIVERSAL HD" -fs "Case-sensitive Journaled HFS+" -type SPARSEBUNDLE -nospotlight -encryption AES-256 -stdinpass -volname ${2} ${2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment