Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
Created November 3, 2012 23:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save NapoleonWils0n/4009356 to your computer and use it in GitHub Desktop.
Save NapoleonWils0n/4009356 to your computer and use it in GitHub Desktop.
macosx: create an encrypted dmg for dropbox
#!/bin/sh
# Create an encrypted dmg for Dropbox
# Command notes: we echo the password to hdiutil and use the -stdinpass to recieve it via stdin
echo -n "password" | hdiutil create -encryption AES-256 -size 5m -fs HFS+J -stdinpass -volname MountedVolumeName DiskImageName.dmg
# attach and detach the dmg
hdiutil attach /path/to/dmg/DiskImageName.dmg
hdiutil detach /Volumes/MountedVolumeName
# resize disk image
hdiutil resize -size 50m DiskImageName.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment