瀏覽代碼

Eject rather than opening the tray -- works even if the disk is still mounted

Zachary Kotlarek 13 年之前
父節點
當前提交
a9c1b8d857
共有 1 個文件被更改,包括 4 次插入 和 1 次删除
  1. 4 1
      discToMkv.sh

+ 4 - 1
discToMkv.sh

@@ -61,4 +61,7 @@ if [ $? -ne 0 ]; then
 fi
 fi
 
 
 # Eject when complete
 # Eject when complete
-drutil -drive "${DR_DRIVE_NUM}" tray open
+DISK="`drutil -drive "${DR_DRIVE_NUM}" status | awk '$3 == "Name:" {print $4}'`"
+if [ -n "${DISK}" ]; then
+	diskutil eject "${DISK}"
+fi