Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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