Created
July 18, 2012 19:12
-
-
Save shrop/3138171 to your computer and use it in GitHub Desktop.
Script to unmount or mount a disk in OS X (Change /dev/disk1 to match the disk needed)
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
#!/bin/bash | |
DISKINFO=`diskutil info /dev/disk1s2 | grep 'Mounted: No'` | |
if [ -n "$DISKINFO" ] ; then | |
diskutil mountDisk /dev/disk1 | |
else | |
diskutil unmountDisk /dev/disk1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment