Просмотр исходного кода

Retry the mount a few times; the process seems flaky in OS X

Zachary Kotlarek 12 лет назад
Родитель
Сommit
ce8fb8e095
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      backup/syncPhotos.sh

+ 9 - 4
backup/syncPhotos.sh

@@ -11,10 +11,15 @@ if [ ! -d "${BASE_REMOTE}" ]; then
 fi
 if [ ! -d "${BASE_REMOTE}/${TARGET}" ]; then
 	MOUNTED_REMOTE=1
-	if ! mount_webdav -s https://webdav.opendrive.com "${BASE_REMOTE}"; then
-		echo "Unable to mount remote drive" 1>&2
-		exit 1
-	fi
+	FAIL_COUNT=0
+	while ! mount_webdav -s https://webdav.opendrive.com "${BASE_REMOTE}"; do
+		if [ $FAIL_COUNT -gt 5 ]; then
+			echo "Unable to mount remote drive" 1>&2
+			exit 1
+		fi
+		FAIL_COUNT=$(( $FAIL_COUNT + 1 ))
+		sleep 5
+	done
 fi
 
 # Mount th local drive if needed