Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
692cc80895
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      mountMedia

+ 4 - 3
mountMedia

@@ -74,9 +74,10 @@ if [ $LOCAL_LINK -eq 0 ] && [ $FORCE -eq 0 ] && ~/bin/video/isMediaMounted; then
 fi
 
 # 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
 
 # Drop local links if we're online