Zachary Kotlarek 12 years ago
parent
commit
10d1b68c9d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      backup/syncPhotos.sh

+ 4 - 0
backup/syncPhotos.sh

@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # Config
+TIMEOUT=20
 export BASE_LOCAL="/Volumes/iPhoto"
 SOURCE_LOCAL="/mnt/media/Pictures/iPhoto.sparsebundle"
 TARGET="Shared.photolibrary"
@@ -28,5 +29,8 @@ if [ -d "${BASE_LOCAL}" ] && [ $MOUNTED_LOCAL -gt 0 ]; then
 	hdiutil detach "${BASE_LOCAL}" >/dev/null 2>&1
 fi
 
+# Always ask the remote drive to detach. There is no other use.
+timeout "${TIMEOUT}" osascript -e 'tell application "OpenDrive" to quit' >/dev/null 2>&1
+
 # Always exit cleanly
 exit 0