From 716573520f1b031bd38f6f42128fd22d46488a97 Mon Sep 17 00:00:00 2001
From: andryyy <andre.peters@debinux.de>
Date: Sat, 24 Jun 2017 00:04:05 +0200
Subject: [PATCH] Use curl for internet connection check, fixes #399

---
 update.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/update.sh b/update.sh
index 469b6ec6..ed87dc6c 100755
--- a/update.sh
+++ b/update.sh
@@ -1,14 +1,5 @@
 #!/bin/bash
 
-echo -en "Checking internet connection... "
-timeout 1 bash -c "echo >/dev/tcp/8.8.8.8/53"
-if [[ $? != 0 ]]; then
-	echo -e "\e[31mfailed\e[0m"
-	exit 1
-else
-	echo -e "\e[32mOK\e[0m"
-fi
-
 if [[ -z $(which curl) ]]; then echo "Cannot find curl, exiting."; exit 1; fi
 if [[ -z $(which docker-compose) ]]; then echo "Cannot find docker-compose, exiting."; exit 1; fi
 if [[ -z $(which docker) ]]; then echo "Cannot find docker, exiting."; exit 1; fi
@@ -16,6 +7,15 @@ if [[ -z $(which git) ]]; then echo "Cannot find git, exiting."; exit 1; fi
 if [[ -z $(which awk) ]]; then echo "Cannot find awk, exiting."; exit 1; fi
 if [[ -z $(which sha1sum) ]]; then echo "Cannot find sha1sum, exiting."; exit 1; fi
 
+echo -en "Checking internet connection... "
+curl -o /dev/null google.com -sm3
+if [[ $? != 0 ]]; then
+	echo -e "\e[31mfailed\e[0m"
+	exit 1
+else
+	echo -e "\e[32mOK\e[0m"
+fi
+
 set -o pipefail
 export LC_ALL=C
 DATE=$(date +%Y-%m-%d_%H_%M_%S)