Created
July 11, 2011 23:41
-
-
Save ejel/1077064 to your computer and use it in GitHub Desktop.
Eject connected external devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
for d in /Volumes/* | |
do | |
if diskutil info $d | grep -P "\bEjectable:\s+Yes" > /dev/null | |
then | |
diskutil eject $d | |
fi | |
done | |
growlnotify -m "External devices ejected." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment