Permalink
Browse files

Updated 'eject' to use the proper verb ('unmountDisk') when force eje…

…cting a non-network volume. (#163)
  • Loading branch information...
1 parent 13a7dd1 commit 7cf821614a5097cad172d158f198cac7518d3735 @morgant committed Dec 7, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 eject
View
@@ -7,7 +7,7 @@
# Initial version.
# v0.2 2010-10-24 - Morgan Aldridge
# Minor cleanup. Automatically prepend /Volumes/ to volume name if omitted.
-# v0.3 2010-11-30 - Morgan Aldridge
+# v0.3 2010-12-07 - Morgan Aldridge
# Added "-f" option to force a disk to eject. Now supports ejecting of
# network volumes.
#
@@ -61,7 +61,11 @@ if [ $# -gt 0 ]; then
if [[ ( $fs_type == "afpfs" ) || ( $fs_type == "smbfs" ) || ( $fs_type == "webdav" ) ]]; then
diskutil unmount $f "$vol"
else
- diskutil eject $f "$vol"
+ if $force; then
+ diskutil unmountDisk $f "$vol"
+ else
+ diskutil eject "$vol"
+ fi
fi
fi
shift

0 comments on commit 7cf8216

Please sign in to comment.