Last active
August 29, 2015 14:17
-
-
Save mmb/ea23a163461a1f21e64f to your computer and use it in GitHub Desktop.
shell script that ejects the USB drive it's on
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 | |
set -e | |
COPY_PATH=/tmp/mount_mmb.sh | |
MOUNT_PATH=/Volumes/mmb | |
cat > $COPY_PATH << EOF | |
#!/bin/bash | |
set -e | |
echo put your script here | |
diskutil eject $MOUNT_PATH | |
rm $COPY_PATH | |
EOF | |
chmod u+x $COPY_PATH | |
exec $COPY_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment