#!/bin/sh
export PATH=$PATH:/usr/bin/local
echo "Looking for $1"
_MYDISK=`diskutil list | grep -w "$1" | awk '{print $6}'`
if [ $_MYDISK = 'TB' ]; then
  _MYDISK=`diskutil list | grep -w "$1" | awk '{print $7}'`
elif [ $_MYDISK = 'GB' ]; then
  _MYDISK=`diskutil list | grep -w "$1" | awk '{print $7}'`
fi
echo "Unmounting $_MYDISK"
diskutil unmount force /dev/$_MYDISK
