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

Check AFP and SMB -- apparently some modems intercept SMB traffic. This is slightly out-of-band but should be pretty reliable. It also leaks less data about our intent when the endpoint is unreachable (as is the common case on public networks)

Zachary Kotlarek 10 лет назад
Родитель
Сommit
692cc80895
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      mountMedia

+ 4 - 3
mountMedia

@@ -74,9 +74,10 @@ if [ $LOCAL_LINK -eq 0 ] && [ $FORCE -eq 0 ] && ~/bin/video/isMediaMounted; then
 fi
 fi
 
 
 # Check for connectivity and server live-ness
 # Check for connectivity and server live-ness
-if ! ~/bin/video/timeout -t "${TIMEOUT}" nc -z "${HOST}" 139 >/dev/null 2>&1; then
-	echo "`basename "${0}"`: Host not available: ${HOST}" 1>&2
-	OFFLINE=1
+if ! ~/bin/video/timeout -t "${TIMEOUT}" nc -z "${HOST}" 548 >/dev/null 2>&1 || \
+	! ~/bin/video/timeout -t "${TIMEOUT}" nc -z "${HOST}" 139 >/dev/null 2>&1; then
+		echo "`basename "${0}"`: Host not available: ${HOST}" 1>&2
+		OFFLINE=1
 fi
 fi
 
 
 # Drop local links if we're online
 # Drop local links if we're online