Skip to content

Instantly share code, notes, and snippets.

@Zettt
Created April 13, 2011 18:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zettt/918133 to your computer and use it in GitHub Desktop.
Save Zettt/918133 to your computer and use it in GitHub Desktop.
Hazel script that will open .dmg files in the background without any interaction required. (It auto-accepts any confirmation dialog.)
#!/bin/sh
file="$1"
extension=${file##*.}
if [[ $extension == "dmg" ]]; then
echo "yes" | hdiutil attach "$1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment